Best way to set a Node/Express app to live or production mode

You have to set the NODE_ENV variable on the command line when you execute your NodeJS application.

For example:

NODE_ENV=production node app.js

Also, NODE_ENV is an environment variable so if set it in the environment on your server, you will not need to provide it every time you execute your application so node app.js will do.

You can set your environment variables in the /etc/environment file. Here are more details on that.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)