api: move service disabling to DISABLED_SERVICES env

This commit is contained in:
wukko
2024-08-23 00:16:26 +06:00
parent ee375a27cd
commit 7a557a97c3
4 changed files with 23 additions and 26 deletions

View File

@@ -203,8 +203,8 @@ export const runAPI = (express, app, __dirname) => {
}
const parsed = extract(normalizedRequest.url);
if (parsed === null) {
return fail(res, "error.api.service.unsupported");
if ("error" in parsed) {
return fail(res, `error.api.service.${parsed.error}`);
}
try {