July 2017
Intermediate to advanced
656 pages
16h 1m
English
When measuring performance, we want the measurement to be relative to a production system. Modules may behave differently in development for convenience reasons, so being aware that this behavior can confound our results can prevent hours of wasted developer time.
Let's see how environment disparity can affect profiling output.
First, we'll install Jade:
$ npm install -g jade
Next, we'll update our server.js code:
const express = require('express')const path = require('path')const app = express()app.set('views', path.join(__dirname, 'views'));app.set('view engine', 'jade');app.get('/hello', (req, res) => { res.render('hello', { title: 'Express' });})app.listen(3000)
We've set up Express to use the views folder for ...