...
|
...
|
@@ -7,6 +7,7 @@ const yohoLib = require('yoho-node-lib'); |
|
|
const pkg = require('./package.json');
|
|
|
const devtools = require('./doraemon/middleware/devtools');
|
|
|
const _ = require('lodash');
|
|
|
let pkgJson;
|
|
|
|
|
|
// 全局注册library
|
|
|
yohoLib.global(config);
|
...
|
...
|
@@ -35,12 +36,24 @@ exports.createApp = async(app) => { |
|
|
});
|
|
|
}
|
|
|
|
|
|
if (!app.locals.devEnv) {
|
|
|
pkgJson = require(`./pkg-${pkg.version}.json`);
|
|
|
}
|
|
|
|
|
|
app.use('/grass/node/status.html', (req, res) => {
|
|
|
res.status(200).end();
|
|
|
});
|
|
|
app.head('*', (req, res) => {
|
|
|
res.status(200).end();
|
|
|
});
|
|
|
app.get('/grass/pkg.json', (req, res) => {
|
|
|
res.set({
|
|
|
'Cache-Control': 'no-cache',
|
|
|
Pragma: 'no-cache',
|
|
|
Expires: (new Date(1900, 0, 1, 0, 0, 0, 0)).toUTCString()
|
|
|
});
|
|
|
res.send(pkgJson);
|
|
|
});
|
|
|
|
|
|
app.use(require('./doraemon/middleware/backlist'));
|
|
|
|
...
|
...
|
|