1 Star 0 Fork 0

王本鑫/arche-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
config.default.js 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
王本鑫 提交于 2021-05-19 22:06 . 改用cjs扩展名
exports.cookieKeys = ['arche is so good', 'I like it so much'];
exports.log4js = {
appenders: {
access: {
type: 'dateFile',
pattern: '-yyyyMMdd.log', //生成文件的规则
filename: 'logs/access.log',
layout: {
type: 'pattern',
pattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] %m',
},
},
context: {
type: 'dateFile',
pattern: '-yyyyMMdd.log',
filename: 'logs/context.log',
layout: {
type: 'pattern',
pattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] [%p] %c - %m',
},
},
console: {
type: 'console',
layout: {
type: 'pattern',
pattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] [%p] %c - %m',
},
}
},
categories: {
default: { appenders: ['console', 'context'], level: 'DEBUG' },
context: { appenders: ['console', 'context'], level: 'DEBUG' },
access: { appenders: ['access'], level: 'INFO' },
}
};
exports.bodyparser = {
formLimit: '1mb',
jsonLimit: '1mb',
};
// exports.redis = {
// host: 'localhost',
// port: '6379',
// password: 'password',
// };
// exports.database = {
// default: {
// connectString: 'localhost',
// user: 'user',
// password: 'password',
// },
// };
// exports.rabbitmq = {
// url: "amqp://user:pwd@localhost",
// };
exports.ratelimit = {
driver: 'memory',
db: new Map(),
duration: 60 * 1000,
errorMessage: 'Sometimes You Just Have to Slow Down.',
id: (ctx) => ctx.ip,
headers: {
remaining: 'Rate-Limit-Remaining',
reset: 'Rate-Limit-Reset',
total: 'Rate-Limit-Total'
},
max: 100,
disableHeader: false,
whitelist: (ctx) => {
// some logic that returns a boolean
},
blacklist: (ctx) => {
// some logic that returns a boolean
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/wbenxin/arche-core.git
git@gitee.com:wbenxin/arche-core.git
wbenxin
arche-core
arche-core
main

搜索帮助