Logging

The Express server, ./lib/express/index.js, uses the logger middleware for logging. The Express logger should only be used in development. In fact, in a production environment, this will seriously impact performance as console functions are synchronous. Let's change the Express server and switch off logging when in production, as shown in the following code snippet:

if (process.env['NODE_ENV'] !== "production")
 app.use(express.logger({ immediate: true, format: 'dev' }));
..................Content has been hidden....................

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