Switch to deno

This commit is contained in:
Dylan Pizzo
2024-12-29 23:00:38 -05:00
parent 5ec05e3db7
commit b81144153b
15 changed files with 232 additions and 1116 deletions

14
src/server/index.ts Normal file
View File

@ -0,0 +1,14 @@
import { serveDir, serveFile } from "jsr:@std/http/file-server";
Deno.serve((req: Request) => {
const pathname = new URL(req.url).pathname;
if (pathname.startsWith("/static")) {
return serveDir(req, {
fsRoot: "src/static",
urlRoot: "static",
});
} else {
return serveFile(req, "src/static/index.html");
}
});