To use the WebAPI, your code must be on a web server accessible to the public Internet. Often developers find it quicker and easier to work on their local development machines, but these are usually behind firewalls, NAT, or are otherwise not able to provide a public URL. You need a way to make your local web server available to the Internet; we find Tunnlr to be an excellent fit for that need, though you could setup your ownreverse SSH tunnel if so inclined. While Tunnlr does have a plug-in for Ruby on Rails, this may be used to redirect traffic to any application running on a port.
The first step is to sign-up for a Tunnlr account. You may select a single plan for USD $5 per month, but you get a 90-day free trial with no credit card required at sign-up. Once you have signed-up and verified your account, they will then provide you with a URL to use to access your tunnel. You will also need to provide them with your public SSH key in your account.
Once this is setup, you need to create your tunnel from your computer. This example creates a shell script that you can reference, rather than writing out the line every time:
Note that your values will be different than those listed in the screenshot - the blank spaces in this line are replaced by values generated specifically for your account in Tunnlr:
If you log into Tunnlr, you can find those values by going down to the "How do I manually start a tunnel?" link. Where it says PORT, you'll typically replace that with the port your web service is using, such as 4567 for Sinatra of maybe port 80 for Limonade.
Next, fire up your tunnel in a terminal window:
With the tunnel open, you can now write an application using one of the WebAPI libraries and run it on the port you specified in the shell script. Here's a Sinatra example using the Ruby WebAPI library:
Now your app has an accessible URL - your Tunnlr URL is listed in your account (as shown in the first screenshot) and can be used as the URL for the WebAPI. Plug it in and add the resource name at the end - for our example, the URL would be: http://web1.tunnlr.com:10917/start.json
Modify the application, save it, then test again - the URL redirects back to your hard drive, so the changes should be immediately detected.