Created
August 19, 2012 23:18
-
-
Save seanredmond/3398477 to your computer and use it in GitHub Desktop.
Trivial Ruby Sinatra example
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'rubygems' | |
require 'sinatra/base' | |
class Greetings < Sinatra::Base | |
get '/greet' do | |
if params[:recipient] == nil | |
"Hello, World" | |
else | |
"Hello, #{params[:recipient]}" | |
end | |
end | |
run! if app_file == $0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment