mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-25 04:22:30 +00:00
fix close editor button
- only evaulate close on web router, not api/static assets - allow /admin pages to still be available
This commit is contained in:
parent
13d6448ab8
commit
b589ab388f
1 changed files with 6 additions and 6 deletions
|
@ -101,19 +101,19 @@ if app.get('env') == 'production'
|
|||
logger.info "Production Enviroment"
|
||||
app.enable('view cache')
|
||||
|
||||
|
||||
|
||||
app.use (req, res, next)->
|
||||
metrics.inc "http-request"
|
||||
crawlerLogger.log(req)
|
||||
next()
|
||||
|
||||
app.use (req, res, next) ->
|
||||
if !Settings.editorIsOpen
|
||||
webRouter.use (req, res, next) ->
|
||||
if Settings.editorIsOpen
|
||||
next()
|
||||
else if req.url.indexOf("/admin") == 0
|
||||
next()
|
||||
else
|
||||
res.status(503)
|
||||
res.render("general/closed", {title:"maintenance"})
|
||||
else
|
||||
next()
|
||||
|
||||
apiRouter.get "/status", (req, res)->
|
||||
res.send("web sharelatex is alive")
|
||||
|
|
Loading…
Reference in a new issue