UNPKG

822 BJavaScriptView Raw
1// default config
2module.exports = {
3 // 服务器启动端口
4 port: 44001,
5 // 是否允许跨域
6 cors: false,
7 // api前缀
8 apiPrefix: '',
9 // 是否打印请求日志
10 requestLog: true,
11 // 是否开启websocket
12 websocket: false,
13 // 中间件配置
14 middleware: [
15 'requestStatsd',
16 'requestMonitor',
17 'router',
18 ],
19 // websocket中间件配置
20 websocketMiddleware: [
21 'socketRouter',
22 ],
23 // log4js配置
24 log4js: {
25 pm2: true,
26 replaceConsole: true,
27 appenders: {
28 out: {type: 'console'},
29 app: {
30 type: 'dateFile',
31 filename: `${share.APP_PATH}/log/log.log`,
32 pattern: '.yyyy-MM-dd',
33 compress: true,
34 },
35 },
36 categories: {
37 default: {
38 appenders: ['out', 'app'],
39 level: 'ALL',
40 },
41 },
42 },
43};