/quicktwiml

Quickly save, share, and call TwiML scripts from your browser.

Primary LanguageJavaScript

quicktwiml

Quickly save, share, and call TwiML scripts from your browser.

  • Shoutout to Twimlbin. I basically wanted to extend your app to use twilio.js.

  • See quicktwiml.herokuapp.com for a demo. Note that, unless I know you personally, I probably haven't shared the login credentials with you, so call functionality is disabled.

The rest of this document explains how to deploy quicktwiml on Heroku.

Create a Heroku App

Sign up with Heroku if you haven't already.

  1. Log into your dashboard at Heroku.

  2. Create a new app, and record its URL (you will need this to configure your TwiML app).

  3. Navigate to your app's dashboard. Under "Resources", click "Get Add-ons" and choose Heroku Postgres.

  4. Select your newly-created database and record its host, database, user, port, and password (you will need these to configure quicktwiml).

Create a TwiML App

Sign up with Twilio if you haven't already.

  1. Log into your dashboard at Twilio, and record your Twilio Account SID and Auth Token (you will need these to configure quicktwiml).

  2. Create a new TwiML app.

  3. Set the Voice and SMS Request URLs to your Heroku app's URL. Make sure to specify HTTPS, and include the trailing slash! For example, https://quicktwiml.herokuapp.com/.

  4. Save your changes, and record your TwiML app's SID (you will need this to configure quicktwiml).

Configure quicktwiml

quicktwiml reads the information you recorded in the previous steps from environment variables. When deploying with Heroku, you can configure these like so:

# Set the Twilio-specific environment variables.
heroku config:set TWILIO_ACCOUNT_SID=$TWILIO_ACCOUNT_SID
heroku config:set TWILIO_AUTH_TOKEN=$TWILIO_AUTH_TOKEN
heroku config:set TWILIO_APP_SID=$TWILIO_APP_SID

# Then set the database-specific environment variables.
heroku config:set APP_DB_HOST=$APP_DB_HOST
heroku config:set APP_DB_NAME=$APP_DB_NAME
heroku config:set APP_DB_USER=$APP_DB_USER
heroku config:set APP_DB_PORT=$APP_DB_PORT
heroku config:set APP_DB_PASS=$APP_DB_PASS

# Optionally set these application-specific variables.
heroku config:set APP_FORCE_HTTPS=true
heroku config:set APP_ENABLE_CALLS=true
heroku config:set APP_DOMAIN=quicktwiml.herokuapp.com

Finally, push this code (or your own fork) to your Heroku app! Questions? Open a GitHub issue and I'll try to help out.