46 lines
951 B
46 lines
951 B
11 months ago
|
/* eslint valid-jsdoc: "off" */
|
||
|
|
||
|
/**
|
||
|
* @param {Egg.EggAppInfo} appInfo app info
|
||
|
*/
|
||
|
module.exports = appInfo => {
|
||
|
/**
|
||
|
* built-in config
|
||
|
* @type {Egg.EggAppConfig}
|
||
|
**/
|
||
|
const config = exports = {};
|
||
|
|
||
|
// use for cookie sign key, should change to your own and keep security
|
||
|
config.keys = appInfo.name + '_1708915616027_8852';
|
||
|
|
||
|
// add your middleware config here
|
||
|
config.middleware = [];
|
||
|
config.mongoose = {
|
||
|
client: {
|
||
|
url: 'mongodb://127.0.0.1:27010/back',
|
||
|
options: {}
|
||
|
}
|
||
|
}
|
||
|
config.security = {
|
||
|
csrf: {
|
||
|
// 判断是否需要 ignore 的方法,请求上下文 context 作为第一个参数
|
||
|
// ignore: ctx => isInnerIp(ctx.ip),
|
||
|
ignore: '/',
|
||
|
},
|
||
|
};
|
||
|
config.bodyParser = {
|
||
|
formLimit: "100mb",
|
||
|
jsonLimit: "100mb",
|
||
|
textLimit: "100mb",
|
||
|
}
|
||
|
// add your user config here
|
||
|
const userConfig = {
|
||
|
// myAppName: 'egg',
|
||
|
};
|
||
|
|
||
|
return {
|
||
|
...config,
|
||
|
...userConfig,
|
||
|
};
|
||
|
};
|