1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00
sinatra/examples/hello/hello.rb
2007-10-04 15:33:55 -07:00

30 lines
398 B
Ruby

$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
require 'sinatra'
production do
sessions :off
end
get '/' do
"Hello World!"
end
get '/erb.xml' do
header 'Content-Type' => 'application/xml'
'<this_is_xml/>'
end
get '/erb' do
erb :hello
end
get '/erb2' do
erb 'Hello <%= params[:name].capitalize || "World" %> 2!'
end
# Custom 404
# get 404 do
# 'Custom 404!!!!'
# end