Tropo is part of CiscoLearn More

How Gists can help for Tropo Scripting Development

Posted on June 2, 2016 by Steve Sfartz

When you go to production, you want the Tropo Scripting Platform to host your scripts so that you get all the scalability and robustness for free as these lay on Tropo operations’ shoulders, 24/7. This is the best practice to handle heavy workload, and this makes Tropo unique for serious communications business logic.

For that to happen, your scripts are deployed at several locations, and synchronized behind the scenes. This is how Tropo delivers communications worldwide, any mobile phone, any country, bi-directional, both calls and SMS.

When you’re developing, however, you are constantly changing your code, and this distribution feature means that any change to your script will take from a few dozen to hundreds of seconds to be active.

Now, let’s see how to reflect your changes immediately at development time.

Tropo downloads your script from a public web server and executes it on our servers. Each time Tropo runs your app, it will fetch the latest version of your script. So a best practice for development is to host your script on a public address, allowing Tropo to skip the distributing the file across our entire network.

I find it very practical to leverage gists for Developement, here’s how.

  1. Create a secret gist, with an extension that reflects the language you’re using (Tropo uses this information to run your script on the right env). A secret gist is publicly available, but doesn’t show up in Github’s search, so adds a bit of privacy.
  2. Grab the URL of your gist, and append /raw/<your-gistname>. For the sake of this example, we’ll go with https://gist.github.com/ObjectIsAdvantag/cc131aab9409f014db22e18e572f722d/raw/gists-can-help-for-tropo-dev.js
  3. In your Tropo application, reference the URL above. Your changes will be immediately reflected (…or in a matter of seconds).

1*wJoQZIMhwTMw_bGO3diasg

Leave a Reply