Created
May 23, 2012 20:48
-
-
Save vbatts/2777708 to your computer and use it in GitHub Desktop.
accessing sinatra application routes
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
require 'rubygems' | |
require 'sinatra/base' | |
require 'json' | |
class MyApp < Sinatra::Base | |
set :routes, @routes | |
get '/' do | |
p settings.routes | |
settings.routes.to_json | |
end | |
get '/monkey' do | |
'monkey' | |
end | |
post '/monkey/:nuts' do | |
p params[:nuts] | |
end | |
end | |
MyApp.run! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment