-
Notifications
You must be signed in to change notification settings - Fork 6
/
app.rb
37 lines (31 loc) · 832 Bytes
/
app.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'sinatra'
require 'sinatra/reloader' if development? # Learn more about the reloader at sinatrarb.com
require 'sinatra/multi_route'
# Uncomment the line's =begin and =end to use this example route
=begin
get '/example' do
"This is an example
<form action='/example' method='post'>
<input type='submit' value='Click To Post'>
</form>"
end
# Multi-Line comment, learn more about it in ruby-lang.org
post '/example' do
"<h1>POSTED</h1>
<a href='/'>Click to go back home</a>"
end
=end
# Learn more about multi-routing at sinatrarb.com
get '/', '/home' do
erb :home
end
get '/about' do
erb :about
end
get '/contact' do
erb :contact
end
# This page gets rendered when the user enters an unidentified route
not_found do
erb :not_found, :layout => :error_layout
end