Authored by 陈峰

Merge branch 'feature/qk' into 'release/6.9.5'

Feature/qk



See merge request !86
... ... @@ -21,6 +21,7 @@ const cpPaths = [
'utils',
'apps/index.html',
`dist/statics/${pkg.name}/degrade-${pkg.version}.html`,
`dist/statics/${pkg.name}/pkg-${pkg.version}.json`,
'dist/manifest.json',
'dist/manifest.server.json'
];
... ...
... ... @@ -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'));
... ...