aweijnitz/http-random
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
Generate a random integer and return it over HTTP. - A simple app to explore Ruby, Sinatra and Heroku in combination Based on the description at http://devcenter.heroku.com/articles/rack Instructions 1. Clone this repository (2. bundle install) 3. ruby random.rb (more fancy: rackup -p 4567 config.ru) Now try http://localhost:4567/?from=1&to=10 The parameters 'from' and 'to' denotes the interval (from <= N < to). See link above about how to push to Heroku. Lessons learned: If you fail for some reason after having created the heroku app with 'heroku create', then you need to destroy the old app and remove the remote target in 'git remote rm heroku' before starting over with 'heroku create' again.