Skip to content
A simple NodeJS app to accept an SMS with the name of a London tube line and respond with the current service status on that line
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
package-lock.json
package.json
server.js

README.md

tube-status-checker

A simple NodeJS app to accept an SMS with the name of a London tube line and respond with the current service status on that line

Prerequisites

  • Sign up for a Nexmo account if you haven't already.

  • Rent an SMS enabled Nexmo virtual number. You can do so by using our Numbers API or via the Nexmo Dashboard.

  • You will need to use ngrok to expose your local server to the internet so Nexmo can reach it.

Getting Started

Clone the repo:

git clone https://github.com/nexmo-community/tube-status-checker.git
cd tube-status-checker

Install dependencies

npm install 

Add configuration information to .env. You will need to include Nexmo and TLF APIs credentials:

heroku config:set apiKey=xxxxx
heroku config:set apiSecret=xxxxxx
heroku config:set app_key=xxxxxxxxxxxxxxxxxx
heroku config:set app_id=xxxxxxx
heroku config:set Nexmo_LVN=xxxxxxxxxxx

Start the express application:

node server.js

Start ngrok:

ngrok http 3000

Link your Nexmo phone number to the /inbound webhook endpoint provided by ngrok.

nexmo link:sms YOUR_NUMBER https://NGROK_SUBDOMAIN.ngrok.io/sms/receive

Send an SMS to the Nexmo registered Nexmo_LVN with the London tube line name as the body message and you will receive a message back with the current status of the line.

Tutorial

For detailed instructions please see this tutorial.

You can’t perform that action at this time.