2019-07-03 07:50:59 +00:00
|
|
|
import { CcServerBoot } from '@cc-server/core'
|
|
|
|
import * as fs from 'fs'
|
|
|
|
import * as path from 'path'
|
|
|
|
|
|
|
|
//process.env.DOCKER_HOST = 'https://ndcli.yumc.pw'
|
2019-08-01 09:22:37 +00:00
|
|
|
// process.env.DOCKER_HOST = '/var/run/docker.sock'
|
|
|
|
process.env.DOCKER_HOST = 'https://dscli.miaowoo.cc'
|
2019-07-03 07:50:59 +00:00
|
|
|
|
|
|
|
let server = new CcServerBoot();
|
|
|
|
|
|
|
|
let modulesDir = path.join(__dirname, 'controller')
|
|
|
|
let list = fs.readdirSync(modulesDir);
|
|
|
|
|
|
|
|
for (let file of list) {
|
|
|
|
let moduleDir = path.join(modulesDir, file)
|
|
|
|
let stat = fs.statSync(moduleDir);
|
|
|
|
if (stat.isFile() && file.endsWith('.js')) {
|
|
|
|
require(moduleDir);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-27 07:03:30 +00:00
|
|
|
server.static().build().start(81);
|