Permalink
Browse files

Merge pull request #84 from ChristianGaertner/bounty-261

Added a pre-installation redirection to /admin
  • Loading branch information...
davidkaneda committed May 24, 2015
2 parents b99bf91 + a214444 commit 1b18ffeaa2b08e6ed9198a5a5a48fd2a679dcbc5
Showing with 6 additions and 1 deletion.
  1. +6 −1 server/routes/frontend.coffee
@@ -61,7 +61,12 @@ app.all '/:frontend*?', (req, res, next) ->
# We could use a $where here, but it's basically the same
# since a basic $where scans all rows (plus this gives us more flexibility)
Route.find {}, 'urlPattern urlPatternRegex template keys', sort: 'sort', (err, routes) ->
return next() unless routes?.length or config.has('catchAll') is yes
unless routes?.length
logger.info 'No routes found. Redirecting to admin panel'
return res.redirect('/' + config.get('adminSegment'))
return next() if config.has('catchAll') is yes
# dynamic renderTime helper
# (startTime is set in index.coffee)

0 comments on commit 1b18ffe

Please sign in to comment.