-
-
Save jaydonnell/264950 to your computer and use it in GitHub Desktop.
This file contains hidden or 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' | |
configure do | |
set :data, "none" | |
end | |
before do | |
content_type 'text/plain', :charset => 'utf-8' | |
request.env['PATH_INFO'].gsub!(/\/$/,'') | |
end | |
get '/' do | |
"Hello World | |
end | |
notfound do | |
"Huh? Where was that again? Hmm, let me look around and get back to you." | |
end | |
# This will show the contents of the variable 'data' from above | |
get '/show' do | |
"data is set to '#{options.data}'\n" | |
end | |
# This sets the contents of the variable 'data' to "one", use /show to display it. | |
get '/one' do | |
set :data, "one" | |
"data is set to '#{options.data}'\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment