-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.rb
37 lines (30 loc) · 835 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
require 'sinatra'
require 'sinatra/reloader' if development?
require 'slim'
require 'json'
require 'digest'
require 'pony'
require_relative 'helpers'
require_relative 'db_helpers'
configure do
Slim::Engine.set_default_options pretty: true, sort_attrs: true
set :views, :slim => 'templates', :scss => 'styles'
set :public_folder, 'assets'
# set :bind, '0.0.0.0'
# set :port, 80
require_relative 'database'
enable :sessions
set :session_secret, 'super secret'
end
get('/styles/styles.css') { scss :styles }
get '/' do
if logged_in?
@account = get_account
@values = Hash[:login_name, @account.login_name, :name, @account.name, :mail, @account.mail]
@game = @account.game unless @account.game.nil?
end
slim :home
end
require_relative 'routes/account'
require_relative 'routes/chat'
require_relative 'routes/game'