mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
module.add(user,problem,record)
This commit is contained in:
commit
d5b1f623f8
43 files changed
+5965
No files matched your search
@@ -0,0 +1,49 @@
|
||||
const
|
||||
yaml = require('js-yaml'),
|
||||
{ defaults } = require('lodash'),
|
||||
fs = require('fs'),
|
||||
path = require('path');
|
||||
|
||||
let options = {
|
||||
db: {
|
||||
name: 'hydro',
|
||||
host: '127.0.0.1',
|
||||
port: 27017,
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
mq: '',
|
||||
listen: {
|
||||
host: '127.0.0.1',
|
||||
port: 8888,
|
||||
domain: '',
|
||||
https: false
|
||||
},
|
||||
smtp: {
|
||||
from: '',
|
||||
host: '',
|
||||
port: 465,
|
||||
user: '',
|
||||
pass: '',
|
||||
secure: false
|
||||
},
|
||||
session: {
|
||||
keys: ['Hydro'],
|
||||
secure: false,
|
||||
domain: '127.0.0.1',
|
||||
saved_expire_seconds: 3600 * 24,
|
||||
unsaved_expire_seconds: 600
|
||||
},
|
||||
constants: {
|
||||
PROBLEM_PER_PAGE: 100,
|
||||
RECORD_PER_PAGE: 100
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
let t = yaml.safeLoad(fs.readFileSync(path.resolve(process.cwd(), 'config.yaml')));
|
||||
options = defaults(t, options);
|
||||
} catch (e) {
|
||||
console.error('Cannot load config');
|
||||
}
|
||||
module.exports = options;
|
||||
Reference in new issue
Block a user