/twiliochat-node

Node implementation of Twilio Chat

Primary LanguageJavaScriptMIT LicenseMIT

twiliochat-node

Node.js | Express implementation of Twilio Chat

Build Status

Run the application

  1. First clone this repository and cd into its directory:

    $ git clone https://github.com/TwilioDevEd/twiliochat-node.git
    
    $ cd twiliochat-node
  2. Install project's dependencies:

    $ npm install
  3. Edit the following environments vars in the .env file. Be sure to replace the place holders with real information

    export 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.

  1. Start the development server

    $ npm start
  2. Expose the application to the wider Internet using ngrok

    $ ngrok http 3000 -host-header="localhost:3000"

That's it

Run the tests

  1. Run backend tests

    $ mocha test
  2. Run javascript tests:

    $ cd public && npm install && npm test

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.