事件本检查时间刷新并推送

This commit is contained in:
luying
2020-10-09 20:26:53 +08:00
parent 50c4aeea2a
commit 2a62b31797
17 changed files with 470 additions and 35 deletions

View File

@@ -1,6 +1,59 @@
import { EggAppConfig, PowerPartial } from 'egg';
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
const path = require('path');
export default () => {
const config: PowerPartial<EggAppConfig> = {};
return config;
export default (appInfo: EggAppInfo) => {
const config = {} as PowerPartial<EggAppConfig>;
// override config from framework / plugin
// use for cookie sign key, should change to your own and keep security
config.keys = appInfo.name + '_1597499383757_3508';
config.security = {
csrf: {
enable: false,
},
domainWhiteList: [ '*' ],
};
config.cors = {
origin: '*', // 匹配规则 域名+端口 *则为全匹配
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
};
// add your egg config in here
config.middleware = [ 'parmsDecode' ];
config.mongoose = {
url: 'mongodb://127.0.0.1/admin', // 内网
options: { useNewUrlParser: true, useUnifiedTopology: true },
};
config.alinode = {
appid: '86043',
secret: '54ef0364995b0c4f2ab42150e29ad30df8327a3a',
error_log: [ '/root/logs/zyz/zyz-web.log', '/root/logs/zyz/common-error.log', '/root/logs/zyz/egg-agent.log' ],
packages: [ '/root/zyz/web-server/package.json' ],
};
config.view = {
root: path.join(appInfo.baseDir, '/app/public'),
defaultViewEngine: 'nunjucks',
mapping: {
'.html': 'nunjucks' //左边写成.html后缀会自动渲染.html文件
},
};
config.static = {
prefix: '/',
dir: path.join(appInfo.baseDir, '/app/public'),
};
// add your special config in here
const bizConfig = {
sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
};
// the return config will combines to EggAppConfig
return {
...config,
...bizConfig,
};
};