Created
April 8, 2013 23:34
-
-
Save mbleigh/5341541 to your computer and use it in GitHub Desktop.
Quick "Hello World" for running Grape and Sinatra together using Rack::Cascade.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this in a new directory, then run `rackup` | |
require 'sinatra' | |
require 'grape' | |
class Web < Sinatra::Base | |
get '/' do | |
"Hello world." | |
end | |
end | |
class API < Grape::API | |
get :hello do | |
{hello: "world"} | |
end | |
end | |
use Rack::Session::Cookie | |
run Rack::Cascade.new [API, Web] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment