Skip to content

Instantly share code, notes, and snippets.

@cschneid
Created July 23, 2008 14:17
Show Gist options
  • Save cschneid/1748 to your computer and use it in GitHub Desktop.
Save cschneid/1748 to your computer and use it in GitHub Desktop.
Dreamhost Hello World Sinatra App
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
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