-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.rb
34 lines (26 loc) · 889 Bytes
/
app.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
require "cuba"
require "cuba/safe"
require "cuba/render"
require "cuba/flash"
require "sequel"
require_relative "helpers/environment_helper"
ENV["RACK_ENV"] ||= "development"
BaseApp::Helpers.init_environment(ENV["RACK_ENV"])
Cuba.plugin Cuba::Safe
Cuba.plugin Cuba::Render
Cuba.use Rack::Session::Cookie, :secret => ENV["SESSION_SECRET"]
Cuba.use Rack::Static,
root: File.expand_path(File.dirname(__FILE__)) + "/public",
urls: %w[/img /css /js /fonts]
Cuba.use Rack::MethodOverride
Dir["./lib/**/*.rb"].each { |rb| require rb }
Dir["./models/**/*.rb"].each { |rb| require rb }
Dir["./validators/**/*.rb"].each { |rb| require rb }
Dir["./concerns/**/*.rb"].each { |rb| require rb }
Dir["./routes/**/*.rb"].each { |rb| require rb }
Dir["./helpers/**/*.rb"].each { |rb| require rb }
Cuba.plugin BaseApp::Helpers
Cuba.use Cuba::Flash
Cuba.define do
run Routes::Base
end