A GitHub walkthrough based off of this tutorial
- Have a valid SMS number that can be used for testing
- Have Node.js
- Have a Twilio account with a valid phone number
- Fork this repository and clone your fork to your local computer
cd
into this repository through your terminal- Run
npm install
to download the necessary packages - In the terminal, run
npm install twilio express-session
-- this is going to be the basis of our edits today npm install express-generator -g
npm install twilio-cli -g
- Open
app.js
- Add the appropriate requirements:
var session = require('express-session');
after the imports
app.use(session({ secret: 'twilio rocks', resave: false, saveUninitialized: false}));
after app is defined. Note: you wouldn't use a secret like 'twilio rocks' in production, this is only for workshop purposes
- Run
npm start
in your terminal to verify that nothing throws an exception - Go to
routes/index.js
- Follow the notes made on that page to complete the workshop, starting with the
INTRO SECTION
on line 15.
- Make sure you're running your local server by using
npm start
- Open another tab in terminal and run
twilio login
and log in with the credentials found in your Twilio console - Run
twilio phone-numbers:update "+yournumber" --sms-url="http://localhost:3000/play-game"
whereyournumber
is instead a 11-digit phone number, i.e. +18005551234