mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
32 lines
495 B
Ruby
32 lines
495 B
Ruby
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib/'
|
|
require 'sinatra'
|
|
|
|
# after_attend :log_fun_stuff
|
|
#
|
|
# helpers do
|
|
# def log_fun_stuff
|
|
# logger.debug "THIS IS COOL!"
|
|
# end
|
|
# end
|
|
|
|
get '/' do
|
|
body <<-HTML
|
|
<form method="POST"><input type="text" name="name"/><input type="submit"></form>
|
|
HTML
|
|
end
|
|
|
|
get '/hello' do
|
|
"Hello World!"
|
|
end
|
|
|
|
post '/' do
|
|
body "You entered #{params[:name]}"
|
|
end
|
|
|
|
get '/erb' do
|
|
erb :index
|
|
end
|
|
|
|
get '/test' do
|
|
erb "Hello <%= params[:name] %>"
|
|
end
|