Production

Our Express server defines a dev reference, based on the value of the NODE_ENV environment variable. This is a standard convention in Node. In fact Express will behave differently when NODE_ENV is set to production, for instance views will be cached in memory.

We can check out production mode with:

$ NODE_ENV=production node index.js  

We should notice this removes styling from our app. This is because we only serve static assets in development mode, and the <link> tags in our views will be generating 404 errors in attempt to fetch the public/styles.css file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.161.225