Aug 29, 2017 · 1 min read
There is mistake in first listing with connecting to database. I think it should be:
app.use((req, res, next) => {
res.locals.connection = mysql.createConnection({
host: ‘localhost’,
user: ‘root’,
password: ‘superSecretPassword’,
database: ‘test’
});
res.locals.connection.connect();
next();
});
