forked from devkato/sinatra-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.rb
38 lines (30 loc) · 943 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
# -*- coding: utf-8 -*-
# ======================================================================
#
# This class is 'modular' type template.
#
# ======================================================================
class AppTemplate < Sinatra::Base
set :sessions, false
set :logging, true
set :dump_errors, true
set :some_custom_option, false
set :public, './public'
# reload this class on development environment.
configure(:development) do
register Sinatra::Reloader
end
# ----------------------------------------------------------------------
# direct response template
# ----------------------------------------------------------------------
get '/' do
puts 'show index'
'index'
end
# ----------------------------------------------------------------------
# erb template
# ----------------------------------------------------------------------
get '/index' do
erb :index
end
end