-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.rb
43 lines (36 loc) · 928 Bytes
/
main.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
38
39
40
41
42
43
# -*- coding: utf-8 -*-
require 'haml'
get '/' do
@wiki = 'masuilab'
@title = getTitleFromGyazz(@wiki)
@menuArray = getMenuFromGyazz(@wiki)
#@subtitle = getSubtitleFromGyazz(@wiki)
haml :index
end
get '/main.css' do
content_type 'text/css', :charset => 'utf-8'
sass :main
end
get '/:wiki/title' do
wiki = params[:wiki]
@title = getTitleFromGyazz(wiki)
end
get '/:wiki/subtitle' do
wiki = params[:wiki]
@subtitle = getTitleFromGyazz(wiki)
end
get '/:wiki/menu.json' do
#wiki = URI.encode(params[:wiki])
@menu = getMenuFromGyazz(params[:wiki]).to_json
end
get '/:wiki/:content.json' do
#wiki = URI.encode(params[:wiki])
#content = URI.encode(params[:content])
@content = getContentFromGyazz(params[:wiki],params[:content]).to_json
end
get '/:wiki' do
@wiki = params[:wiki]
@title = getTitleFromGyazz(@wiki)
@menuArray = getMenuFromGyazz(@wiki)
haml :index
end