Skip to content

aweijnitz/http-random

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

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.

About

Simple Ruby script to generate a random number over HTTP.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages