An application can go through multiple stages throughout its life cycle—two of the most common stages would be development and production. Specific configurations can be set up to host the app in its various stages. These configured habitats are known as server tiers or environments.
Development and production codes have different requirements. For instance, during development we will most likely want a detailed error output to the client, for debugging purposes. In production, we protect ourselves from opportunistic exploitation by revealing as little internal information as possible.
Express has an
env setting that determines its value from an operating system environment variable,
NODE_ENV, falling back to the ...