Created
July 23, 2008 14:17
-
-
Save cschneid/1748 to your computer and use it in GitHub Desktop.
Dreamhost Hello World Sinatra App
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 'sinatra/lib/sinatra.rb' | |
require 'rubygems' | |
Sinatra::Application.default_options.merge!( | |
:run => false, | |
:env => :production, | |
:raise_errors => true | |
) | |
log = File.new("sinatra.log", "a") | |
STDOUT.reopen(log) | |
STDERR.reopen(log) | |
require 'test.rb' | |
run Sinatra.application |
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
get '/' do | |
"Worked on dreamhost" | |
end | |
get '/foo' do | |
"Foo" | |
end | |
get '/foo/:bar' do | |
"You asked for foo/#{params[:bar]}" | |
end | |
get '/error' do | |
raise "A test error" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment