config
This commit is contained in:
1 parent
02577898ae
commit
1689cfec1e
2 files changed
+42
No files matched your search
@@ -0,0 +1,41 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
require('dotenv').config({path: path.resolve(__dirname, '../../.env')});
|
||||
|
||||
module.exports = appInfo => {
|
||||
|
||||
return {
|
||||
static: {
|
||||
maxAge: 0,
|
||||
buffer: false,
|
||||
preload: false,
|
||||
maxFiles: 0,
|
||||
},
|
||||
logger: {
|
||||
outputJSON: true,
|
||||
level: 'INFO',
|
||||
// level: 'DEBUG',
|
||||
// allowDebugAtProd: true,
|
||||
dir: path.join(appInfo.baseDir, 'logs'),
|
||||
contextFormatter(meta) {
|
||||
return `[${meta.date}] [${meta.level}] [${meta.ctx.method} ${meta.ctx.url}] ${meta.message}`;
|
||||
}
|
||||
},
|
||||
knex: {
|
||||
client: {
|
||||
dialect: 'mysql',
|
||||
connection: {
|
||||
host: process.env.DB_HOST,
|
||||
port: process.env.DB_PORT,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASSWORD,
|
||||
database: 'jianghujs_workflow'
|
||||
},
|
||||
pool: { min: 0, max: 10 },
|
||||
acquireConnectionTimeout: 30000
|
||||
},
|
||||
app: true
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -10,6 +10,7 @@
|
||||
"dependencies": {
|
||||
"@jianghujs/jianghu": "4.1.0",
|
||||
"dayjs": "^1.11.4",
|
||||
"dotenv": "^16.3.1",
|
||||
"egg": "^2.15.1",
|
||||
"egg-scripts": "^2.11.0"
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user