forked from emojitracker/emojitrack-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ru
More file actions
38 lines (32 loc) · 1 KB
/
config.ru
File metadata and controls
38 lines (32 loc) · 1 KB
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
require 'rack-timeout'
require 'rack-cache'
require 'dalli'
require 'memcachier'
# Defined in ENV on Heroku. To try locally, start memcached and uncomment:
# ENV["MEMCACHIER_SERVERS"] = "localhost"
if memcache_servers = ENV["MEMCACHIER_SERVERS"]
use Rack::Cache,
verbose: true,
metastore: "memcached://#{memcache_servers}",
entitystore: "memcached://#{memcache_servers}"
end
$stdout.sync = true
# deflate output for bandwidth savings
use Rack::Deflater
# set a timeout for slow connections to not use up dyno slots
# unicorn will have this set too, so this number should be lower than unicorns
use Rack::Timeout
Rack::Timeout.timeout = 10
require "./lib/config"
if is_development_frontend_only?
puts "Running in frontend only mode, API and Admin routes omitted"
require "./web"
map('/') { run WebApp }
else
require "./web"
require "./web_api"
require "./web_admin"
map('/') { run WebApp }
map('/api') { run WebAPI }
map('/admin') { run WebAdmin }
end