devtools.js
351 Bytes
'use strict';
const fs = require('fs');
let devHost = '172.16.6.134';
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();
};
};