Return JSON for unmatched api routes
This commit is contained in:
parent
72a1dc6541
commit
7ff9aab027
1 changed files with 3 additions and 0 deletions
|
|
@ -189,6 +189,9 @@ export default {
|
|||
}
|
||||
return handleContact(request, env);
|
||||
}
|
||||
if (url.pathname.includes("/api/")) {
|
||||
return jsonResponse({ ok: false, error: "Not found." }, 404);
|
||||
}
|
||||
if (env.ASSETS?.fetch) {
|
||||
return env.ASSETS.fetch(request);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue