This commit is contained in:
chaosBreaking
2019-08-31 14:59:13 +08:00
commit dc5423d356
65 changed files with 3813 additions and 0 deletions

23
index.js Normal file
View File

@@ -0,0 +1,23 @@
'use strict';
/**
1.创建数据库连接
2.启动任务队列
3.启动web服务器
*/
const mylog = require('./logger')({ root: 'log', file: 'tic.log' });
global.mylog = mylog;
const runServer = require('./src/server');
const startJob = require('./src/jobs');
const dbConnect = require('./src/common/dbConnect');
const run = tasks => {
[...tasks].reduce((value, func) => {
if (value instanceof Promise) {
return value.then(func);
}
return func(value);
});
};
run([dbConnect, startJob,runServer]);