Skip to content

Instantly share code, notes, and snippets.

@mtodd
Forked from jnewland/init.rb
Created January 22, 2009 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtodd/50628 to your computer and use it in GitHub Desktop.
Save mtodd/50628 to your computer and use it in GitHub Desktop.
#don't use sinatra/main. we don't want the kitchen sink, just pretty rack apps
require 'sinatra/base'
class SinatraRailsPlugin < Sinatra::Base
get '/foo' do
'bar'
end
#this hackeration is required for sinatra to be a nice rack citizen
error 404 do
@app.call(env)
end
end
config.after_initialize do
config.gem 'sinatra'
config.middleware.use SinatraRailsPlugin
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment