process.env vs app.get('env') on getting the express.js environment

Solution 1:

There is no significant difference.

Express app.get('env') returns 'development' if NODE_ENV is not defined. So you don't need the line to test its existence and set default.