Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
This is an example Sinatra application ready to run on Heroku using IronWorker and IronMQ Add Ons.
Ruby JavaScript
tree: a710c6de34

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
static
views
workers
.gitignore
Gemfile
Gemfile.lock
README.md
config.ru
hello.rb

README.md

Getting Started

Clone this repo:

git clone git@github.com:iron-io/heroku_sinatra_example.git

Now cd into the directory:

cd heroku_sinatra_example

Install required gems:

sudo bundle install

Now create a heroku app for it (this assumes you're already logged into heroku):

heroku create --stack cedar

Ok, now we're ready to run on Heroku, but first we need to add the Iron.io Add-ons:

heroku addons:add iron_worker:starter
heroku addons:add iron_mq:rust

Grab your IronWorker project id and token from:

heroku config

And put them in a file in this directory called iron.json in this format:

{
    "project_id":"PROJECT_ID",
    "token":"TOKEN"
}

Upload the worker:

iron_worker upload workers/tweet

Then just push to heroku!

git push heroku master

Live Demo

Here's a live running example of this app: http://evening-planet-3202.herokuapp.com/

Development

To run in development, you need a token and project_id from your Iron.io account. Login at http://www.iron.io to get it.

Then start this sinatra app using this command, replacing my_token and my_project_id with your credentials:

IRON_WORKER_TOKEN=my_token IRON_WORKER_PROJECT_ID=my_project_id rackup -p 3000 config.ru
Something went wrong with that request. Please try again.