You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.4 KiB
62 lines
1.4 KiB
3 years ago
|
# An empty web server.
|
||
|
|
||
|
## default config
|
||
|
```js
|
||
|
'use strict';
|
||
|
/*jslint node:true*/
|
||
|
const path = require('path');
|
||
|
const os = require('os');
|
||
|
const dev = process.env.DEBUG || true;
|
||
|
const product = {
|
||
|
port: 80,
|
||
|
mws: [],
|
||
|
dc: {
|
||
|
url: "postgres://postgres:postgres@10.8.30.21:5432/postgres",
|
||
|
opts: {
|
||
|
pool: {
|
||
|
max: 20,
|
||
|
min: 10,
|
||
|
idle: 10000
|
||
|
}
|
||
|
},
|
||
|
models: []
|
||
|
},
|
||
|
logger: {
|
||
|
level: 'debug',
|
||
|
json: false,
|
||
|
filename: path.join(__dirname, 'log', 'runtime.txt'),
|
||
|
colorize: true,
|
||
|
maxsize: 1024 * 1024 * 5,
|
||
|
rotationFormat: false,
|
||
|
zippedArchive: true,
|
||
|
maxFiles: 10,
|
||
|
prettyPrint: true,
|
||
|
label: '',
|
||
|
timestamp: true,
|
||
|
eol: os.EOL,
|
||
|
tailable: true,
|
||
|
depth: null,
|
||
|
showLevel: true,
|
||
|
maxRetries: 1
|
||
|
}
|
||
|
};
|
||
|
|
||
|
const development = {
|
||
|
port: 4000,
|
||
|
mws: [],
|
||
|
dc: {
|
||
|
url: "sqlite://sqlite:sqlite@localhost:5432/sqlite",
|
||
|
opts: {
|
||
|
storage: path.join(__dirname, 'test', 'test.db'),
|
||
|
define: {
|
||
|
"timestamps": false, "freezeTableName": true
|
||
|
}
|
||
|
},
|
||
|
models: []
|
||
|
},
|
||
|
logger: product.logger
|
||
|
};
|
||
|
development.logger.filename = path.join(__dirname, 'log', 'development.txt');
|
||
|
|
||
|
module.exports = dev ? development : product;
|
||
|
```
|