Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

iAmPlus/rack-routing-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rack Routing Demo


This app shows how to use the Rack Routing gem.

Route http requests to Ruby methods:

  1. GET / => get_root
  2. GET /foos/:id => get_foo (with @url_params)
  3. POST /foos => post_foos

Examples:

Request: POST /foos, { "bar":"baz" }
Ruby:

def post_foos
  Foo.create @params
  Rack::Response.new( 'Foo was created.', 200 )
end

To run locally:

rackup

This will start the server on port 9292.

To run specs:

rspec

or

guard

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages