-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ru
42 lines (27 loc) · 808 Bytes
/
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
# frozen_string_literal: true
require 'rack/deflater'
require 'rack/protection'
require 'sinatra'
require 'slim'
require 'yaml'
# Project Root
$root = File.dirname(__FILE__)
# Global Settings and Utilities
puts '--- Loading Helpers ---'
utils_root = "#{$root}/helpers"
require "#{utils_root}/global_utils"
GlobalUtils.declare_globals
require "#{utils_root}/content_helpers"
# Sinatra Configuration
configure do
use Rack::Deflater
use Rack::Protection, except: %i[remote_token session_hijacking]
set :server, :puma
set :bind, '0.0.0.0'
end
puts '--- Loading Controllers ---'
controllers = YAML.load_file("#{$root}/controllerlist.yml")
controllers.each do |controller|
require "#{$root}/controllers/#{controller['file']}"
map(controller['path']) { run eval(controller['name']) }
end