devtools.js
445 Bytes
'use strict';
const fs = require('fs');
const dnsPrefetch = require('../../config/dns-prefetch');
let devHost = '127.0.0.1';
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,
dnsPrefetch: dnsPrefetch
});
next();
};
};