Skip to content
Permalink
Browse files

perf(express): speed up express by setting process.env.NODE_ENV to pr…

…oduction on prod builds
  • Loading branch information
jyounce committed Apr 9, 2016
1 parent 396c5c2 commit 2a6bae0b24ff153d033fc4014590b9d36833aff8
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/src/server/init-server.coffee
@@ -7,6 +7,10 @@ appFilePath = path.resolve dir, '..', config.dist.app.server.scripts.file
clientDirPath = path.resolve dir, '..', '..', config.dist.app.client.dirName # creates absolute path to the client folder
serverDirPath = path.resolve dir, '..', '..', config.dist.app.server.dirName

# set NODE_ENV (conditionally)
# ============================
process.env.NODE_ENV = 'production' if config.env.is.prod

# create the server object
# ========================
server = require './server'

0 comments on commit 2a6bae0

Please sign in to comment.
You can’t perform that action at this time.