-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ru
executable file
·30 lines (25 loc) · 1.25 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
require 'sinatra/base'
require 'rack/contrib'
# Lazy load helpers (doesn't work with controllers in 10.13/Homebrew ruby)
Dir.glob('./{helpers}/*.rb').each { |file| require_relative file }
# Direct includes are required on OX 10.13 / ruby 2.5.1 (installed via homebrew)
# May be installation specific
require_relative './controllers/application_controller.rb'
require_relative './controllers/results_controller.rb'
require_relative './controllers/startlist_controller.rb'
require_relative './controllers/registration_controller.rb'
require_relative './controllers/session_controller.rb'
# Rack options
# \ --host 0.0.0.0
# Sinatra has a mare dealing with JSON encoded requests - Rack deals with this
use Rack::JSONBodyParser
# run Perseus::App
map('/') { run Perseus::ApplicationController }
map('/results') { run Perseus::ResultsController }
map('/startlist') { run Perseus::StartlistController }
map('/registration') { run Perseus::RegistrationController }
map('/session') { run Perseus::SessionController }
# Redundant map (static content served via NGINX for now)
# map('/displays') { run Perseus::DisplayController }
# Bespoke controller for handling the CWIF Qualification
# map('/cwif') { run Perseus::CWIFController }