Skip to content

Instantly share code, notes, and snippets.

@vbatts
Created May 23, 2012 20:48
Show Gist options
  • Save vbatts/2777708 to your computer and use it in GitHub Desktop.
Save vbatts/2777708 to your computer and use it in GitHub Desktop.
accessing sinatra application routes
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