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
-
Copy the sample configuration file and edit it to match your configuration.
$ cp .env.example .env
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
That's it!
If you want your chat application to be reachable publicly in the internet, you can use a service like ngrok.
-
Expose the application to the wider Internet
$ ngrok http 3000
-
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.