Node.js: Check if you are in debug or production mode

Sometimes you have to use other values in a variable when your application is in production as if when you are debugging it. For example you have to use another web service URL. Here is how can do it: var webApiUrl; if (process.env.NODE_ENV === „production“) { // use in production webApiUrl = „http://myapp.online/awesome-app/api“; } else… Node.js: Check if you are in debug or production mode weiterlesen