diff --git a/src/server/index.ts b/src/server/index.ts index 3d32eaa..f281ceb 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -86,6 +86,9 @@ apiRouter.loadAPIMethods().then(() => { app.route("/", apiRouter.root) console.log("API OK!") + // moved here to ensure it's matched last + app.get("/:fileId", (ctx) => app.fetch(ctx.req.raw, ctx.env, ctx.executionCtx)) + // listen on 3000 or MONOFILE_PORT // moved here to prevent a crash if someone manages to access monofile before api routes are mounted