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