mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
koa router不再支持*的路由注册方式。
This commit is contained in:
1 parent
37d7bb526c
commit
65a50275b1
3 files changed
+9
-3
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.12.18",
|
"version": "2.12.19",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -12,7 +12,14 @@ class NotFoundHandler extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function apply() {
|
export async function apply() {
|
||||||
Route('notfound', '*', NotFoundHandler);
|
Route('notfound', '/:a', NotFoundHandler);
|
||||||
|
Route('notfound', '/:a/:b', NotFoundHandler);
|
||||||
|
Route('notfound', '/:a/:b/:c', NotFoundHandler);
|
||||||
|
Route('notfound', '/:a/:b/:c/:d', NotFoundHandler);
|
||||||
|
Route('notfound', '/:a/:b/:c/:d/:e', NotFoundHandler);
|
||||||
|
Route('notfound', '/:a/:b/:c/:d/:e/:f', NotFoundHandler);
|
||||||
|
Route('notfound', '/:a/:b/:c/:d/:e/:f/:g', NotFoundHandler);
|
||||||
|
Route('notfound', '/:a/:b/:c/:d/:e/:f/:g/:h', NotFoundHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
global.Hydro.handler.notfound = apply;
|
global.Hydro.handler.notfound = apply;
|
||||||
@@ -793,7 +793,6 @@ export async function start() {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
app.use(router.routes()).use(router.allowedMethods());
|
app.use(router.routes()).use(router.allowedMethods());
|
||||||
Route('notfound_handler', '*', Handler);
|
|
||||||
server.listen(argv.port || port);
|
server.listen(argv.port || port);
|
||||||
console.log('Server listening at: %s', argv.port || port);
|
console.log('Server listening at: %s', argv.port || port);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user