Skip to content

Instantly share code, notes, and snippets.

@mbleigh
Created April 8, 2013 23:34
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbleigh/5341541 to your computer and use it in GitHub Desktop.
Save mbleigh/5341541 to your computer and use it in GitHub Desktop.
Quick "Hello World" for running Grape and Sinatra together using Rack::Cascade.
# 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