We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72b8207 commit 234e929Copy full SHA for 234e929
buildCache.js
@@ -3,7 +3,9 @@ import puppeteer from "puppeteer";
3
const server = Bun.serve({
4
async fetch (req) {
5
const path = new URL(req.url).pathname.replace("/convert/", "") || "index.html";
6
- return new Response(Bun.file(`${__dirname}/dist/${path}`));
+ const file = Bun.file(`${__dirname}/dist/${path}`);
7
+ if (!(await file.exists())) return new Response("Not Found", { status: 404 });
8
+ return new Response(file);
9
},
10
port: 8080
11
});
0 commit comments