summaryrefslogtreecommitdiffhomepage
path: root/packages/function/src/api.ts
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-07-11 04:55:56 -0500
committerGitHub <[email protected]>2025-07-11 04:55:56 -0500
commit7e1fc275e70dcf068370d69f238d7749d5263d9a (patch)
tree0d69a9fecddaf7132986a8aabf4b99e1b0b98141 /packages/function/src/api.ts
parent3b9b391320f6ff59dd86970558fff8cd3f215a41 (diff)
downloadopencode-7e1fc275e70dcf068370d69f238d7749d5263d9a.tar.gz
opencode-7e1fc275e70dcf068370d69f238d7749d5263d9a.zip
fix: avoid worker exception, graceful 404 (#869)
Diffstat (limited to 'packages/function/src/api.ts')
-rw-r--r--packages/function/src/api.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/function/src/api.ts b/packages/function/src/api.ts
index a28f286fc..150afd887 100644
--- a/packages/function/src/api.ts
+++ b/packages/function/src/api.ts
@@ -108,7 +108,7 @@ export class SyncServer extends DurableObject<Env> {
}
export default {
- async fetch(request: Request, env: Env, ctx: ExecutionContext) {
+ async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
const url = new URL(request.url)
const splits = url.pathname.split("/")
const method = splits[1]
@@ -275,5 +275,7 @@ export default {
headers: { "Content-Type": "application/json" },
})
}
+
+ return new Response("Not Found", { status: 404 })
},
}