Node.js | Express implementation of Twilio Chat
-
First clone this repository and
cd
into its directory:$ git clone https://github.com/TwilioDevEd/twiliochat-node.git $ cd twiliochat-node
-
Install project's dependencies:
$ npm install
-
Edit the following environments vars in the
.env
file. Be sure to replace the place holders with real informationexport TWILIO_ACCOUNT_SID=Your-Account-SID export TWILIO_API_KEY=Your-Twilio-API-KEY export TWILIO_API_SECRET=Your-Twilio-API-SECRET export TWILIO_IPM_SERVICE_SID=Your-Twilio-IPM-SERVICE-SID
You can find your TWILIO_ACCOUNT_SID
in your
Twilio Account Settings.
For TWILIO_API_KEY
and TWILIO_API_SECRET
you need to go
here. There
youl'll be able to create a new API key obtaining the two required values.
For TWILIO_IPM_SERVICE_SID
you can go here,
where you must create an IP Messaging Service. When the service is created you'll
have access to the service's SID.
-
Start the development server
$ npm start
-
Expose the application to the wider Internet using ngrok
$ ngrok http 3000 -host-header="localhost:3000"
That's it
-
Run backend tests
$ mocha test
-
Run javascript tests:
$ cd public && npm install && npm test
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.