Saturday, November 6, 2010

Simple Heroku Add-on with Sinatra

I was playing around with creating Heroku add-ons, and the tutorial page is helpful, but the examples provided are somewhat complex.  I've created a project on GitHub with a complete sample Sinatra app.  Some particular notes:

  1. to_json is not in Sinatra, so you'll need to pull in the json gem
  2. I include a config parameter to demonstrate how to nest parameters properly; that's not strictly required, but any practical add-on will need that
  3. The requirement for kensa to use  HTTP Basic Authentication seems odd to me, but the Sinatra application simply loads in Rack::Auth::Basic and requires it for every URL handler.
Stay tuned for other sample Heroku add-ons.

No comments:

Post a Comment