Skip to content

Instantly share code, notes, and snippets.

@seanredmond
Created August 19, 2012 23:18
Show Gist options
  • Save seanredmond/3398477 to your computer and use it in GitHub Desktop.
Save seanredmond/3398477 to your computer and use it in GitHub Desktop.
Trivial Ruby Sinatra example
#!/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