Skip to content

Commit

Permalink
Turn off admin and error handling in production.
Browse files Browse the repository at this point in the history
  • Loading branch information
techpines committed Jul 5, 2013
1 parent f7e7ed9 commit 78b7f0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rack.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ class exports.Rack extends EventEmitter
else @on 'complete', handle

handleError: (request, response, next) ->
# No admin in production for now
return next() if process.env.NODE_ENV is 'production'
errorPath = pathutil.join __dirname, 'admin/templates/error.jade'
fs.readFile errorPath, 'utf8', (error, contents) =>
return next error if error?
Expand All @@ -106,6 +108,8 @@ class exports.Rack extends EventEmitter
stack: @currentError.stack.split '\n'

handleAdmin: (request, response, next) ->
# No admin in production for now
return next() if process.env.NODE_ENV is 'production'
split = request.url.split('/')
if split.length > 2
path = request.url.replace '/asset-rack/', ''
Expand Down

0 comments on commit 78b7f0c

Please sign in to comment.