port /:fileId

This commit is contained in:
May 2024-03-09 17:27:42 -08:00
parent 8f1b1ada84
commit d0c1c7be9c

View file

@ -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