-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.ru
70 lines (54 loc) · 1.06 KB
/
config.ru
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
require 'sequel'
require './proc'
require './template'
#connect to db
DB =
Sequel.connect(ENV['DATABASE_URL'] || 'sqlite://development.db')
#Sequel.connect('sqlite://development.db')
cut = Cut.new
doc = Doc.new
pro = Pro.new
how = How.new
his = His.new
builder = Rack::Builder.new do
#middleware
use Rack::ShowExceptions
use Rack::Reloader
use Rack::Static, :urls => [ "/stylesheets", "/images" ] # did not specify root here, but probably should when site's live
#url mapping
map '/' do
run cut
end
map '/thedocument' do
run doc
end
map '/process' do
run pro
end
map '/how' do
run how
end
map '/history_of_cutup' do
run his
end
end
# rack this up
run builder
#migration #1
#DB.create_table :temp do
# primary_key :id
# String :entry
#end
#migration #2
#DB.create_table :document do
# primary_key :id
# String :master
# String :title
#end
#migration #3
#DB.alter_table(:temp) do
# set_column_type :entry, String, :text => true
#end
#DB.alter_table(:document) do
# set_column_type :master, String, :text => true
#end