多线程(cluster)

This commit is contained in:
masnn committed 2020-06-08 23:21:40 +08:00
1 parent 1c8b62a6d9
commit 45f1184d68
7 files changed
+169 -73

No files matched your search

+3 -3
View File
@@ -438,12 +438,12 @@ function Validate(key, func) {
else validate[key] = [func];
}
async function start() {
async function start(port) {
app.use(morgan(':method :url :status :res[content-length] - :response-time ms'));
app.use(router.routes()).use(router.allowedMethods());
Route('*', Handler);
server.listen(await system.get('server.port'));
console.log('Server listening at: %s', await system.get('server.port'));
server.listen(port);
if (port) console.log('Server listening at: %s', port);
}
global.Hydro.service.server = module.exports = {