mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
多线程(cluster)
This commit is contained in:
1 parent
1c8b62a6d9
commit
45f1184d68
7 files changed
+169
-73
No files matched your search
@@ -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 = {
|
||||
|
||||
Reference in new issue
Block a user