Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

TwilioDevEd/twiliochat-servlets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twilio

Important Notice

We intend to sunset the Programmable Chat API on July 25, 2022 to focus on the next generation of chat: the Twilio Conversations API. Find out about the EOL process. We have also prepared this Migration Guide to assist in the transition from Chat to Conversations.

twiliochat with Servlets

Build Status

Java implementation of Twilio Chat

Run the application

  1. Clone the repository and cd into it.

  2. 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, SID and SECRET. For TWILIO_CHAT_SERVICE_SID you can go here, where you must create a Programmable Chat Messaging Service. When the service is created you'll have access to the service's SID.

  1. Load the configuration file:

    $ source .env
  2. Run the application using gretty gradle plugin.

$ ./gradlew appRun

Now you can access the application at http://localhost:8080/twiliochat-servlets.

Expose your localhost to the internet

If you want your chat application to be reachable publicly in the internet, you can use a service like ngrok.

  1. Expose the application to the wider Internet

    $ ngrok http 8080

Dependencies

This application uses this Twilio helper library:

Run the tests

  1. Run at the top-level directory:

    $ ./gradlew test
  2. Run javascript tests:

    $ cd src/main/webapp/ && npm install && npm test

Meta

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