Switch to deno
This commit is contained in:
14
src/server/index.ts
Normal file
14
src/server/index.ts
Normal 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");
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user