-
-
Save digitalknk/271982 to your computer and use it in GitHub Desktop.
This file contains 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
script/generate plugin HelloWorld | |
# vendor/plugins/hello_world/init.rb | |
Rails.configuration.gem "sinatra" | |
Rails.configuration.middleware.insert_before("ActionController::Failsafe", "HelloWorld") | |
# vendor/plugins/hello_world/lib/hello_world.rb | |
# your sinatra app goes here... | |
require 'sinatra/base' | |
class HelloWorld < Sinatra::Base | |
get "/hello" do | |
"Hello World!" | |
end | |
#this hackeration is required for sinatra to be a nice rack citizen | |
error 404 do | |
@app.call(env) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment