core: fix 404 page display

This commit is contained in:
undefined committed 2025-05-07 21:37:52 +08:00
1 parent 83da1c8d66
commit cd56ffe55b
11 files changed
+48 -30

No files matched your search

+3 -3
View File
@@ -16,7 +16,7 @@
"@aws-sdk/lib-storage": "3.726.1",
"@aws-sdk/s3-presigned-post": "3.726.1",
"@aws-sdk/s3-request-presigner": "3.726.1",
"@babel/code-frame": "^7.26.2",
"@babel/code-frame": "^7.27.1",
"@cordisjs/plugin-timer": "1.1.1",
"@hydrooj/common": "workspace:^",
"@hydrooj/framework": "workspace:^",
@@ -41,7 +41,7 @@
"mongodb": "^6.16.0",
"mongodb-uri": "^0.9.7",
"nanoid": "^5.1.5",
"nodemailer": "^6.10.1",
"nodemailer": "^7.0.2",
"notp": "^2.0.3",
"p-queue": "^8.1.0",
"sanitize-filename": "^1.6.3",
@@ -49,7 +49,7 @@
"schemastery": "^3.16.1",
"semver": "^7.7.1",
"shorty.js": "^1.0.1",
"superagent": "^10.2.0",
"superagent": "^10.2.1",
"tar": "6.2.1",
"thirty-two": "^1.0.2",
"ua-parser-js": "^2.0.3"
+4 -2
View File
@@ -91,7 +91,8 @@ export async function apply(ctx: Context) {
xhost: system.get('server.xhost'),
});
if (process.env.HYDRO_CLI) return;
ctx.inject(['server', 'oauth'], ({ server, on, oauth }) => {
ctx.inject(['server', 'oauth', 'setting'], (childContext) => {
const { server, on, oauth } = childContext;
server.addHandlerLayer('init', async (c, next) => {
const init = Date.now();
try {
@@ -107,7 +108,8 @@ export async function apply(ctx: Context) {
}
});
applyApiHandler(ctx, 'api', '/api/:op');
applyApiHandler(childContext, 'api', '/api/:op');
server.setDefaultContext(childContext);
for (const addon of [...Object.values(global.addons)].reverse()) {
const dir = resolve(addon, 'public');