forked from maccman/sinatra-blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.rb
49 lines (38 loc) · 927 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require 'rubygems'
require 'bundler'
# Setup load paths
Bundler.require
$: << File.expand_path('../', __FILE__)
$: << File.expand_path('../lib', __FILE__)
# Require base
require 'sinatra/base'
require 'active_support/core_ext/string'
require 'active_support/core_ext/array'
require 'active_support/core_ext/hash'
require 'active_support/json'
libraries = Dir[File.expand_path('../lib/**/*.rb', __FILE__)]
libraries.each do |path_name|
require path_name
end
require 'app/extensions'
require 'app/models'
require 'app/helpers'
require 'app/routes'
module Blog
class App < Sinatra::Application
configure do
set :root, Dir.pwd
set :views, 'app/views'
disable :method_override
disable :static
end
use Rack::Deflater
use Rack::Standards
use Routes::Static
unless settings.production?
use Routes::Assets
end
use Routes::Posts
end
end
include Blog::Models