devtools.js
348 Bytes
'use strict';
const fs = require('fs');
let devHost = 'localhost';
fs.readFile('.devhost', (err, buf)=> {
if (!err) {
devHost = JSON.parse(buf.toString()).host;
}
});
module.exports = () => {
return (req, res, next) => {
Object.assign(res.locals, {
devHost: devHost
});
next();
};
};