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