Allow to put app in maintenance mode (closes #27)
This commit is contained in:
parent
82554e0356
commit
1a2933bf48
@ -1,4 +1,5 @@
|
|||||||
development: &defaults
|
development: &defaults
|
||||||
|
maintenance: false
|
||||||
riak: &riak_defaults
|
riak: &riak_defaults
|
||||||
host: localhost
|
host: localhost
|
||||||
http_port: 8098
|
http_port: 8098
|
||||||
|
|||||||
@ -47,6 +47,10 @@ class LiquorCabinet < Sinatra::Base
|
|||||||
# Cabinet doors
|
# Cabinet doors
|
||||||
#
|
#
|
||||||
|
|
||||||
|
before do
|
||||||
|
halt 503 if settings.maintenance rescue false
|
||||||
|
end
|
||||||
|
|
||||||
["/:user/*/:key", "/:user/:key", "/:user/*/", "/:user/"].each do |path|
|
["/:user/*/:key", "/:user/:key", "/:user/*/", "/:user/"].each do |path|
|
||||||
before path do
|
before path do
|
||||||
headers 'Access-Control-Allow-Origin' => '*',
|
headers 'Access-Control-Allow-Origin' => '*',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user