Migrate to Bun. Not yet tidy.

This commit is contained in:
tedspare
2024-03-18 23:22:59 -04:00
parent 8744289c30
commit 675b527833
20 changed files with 886 additions and 1729 deletions
+22
View File
@@ -0,0 +1,22 @@
import { serve } from "bun";
const port = 3000;
serve({
port,
fetch: async (req) => {
const url = new URL(req.url);
console.log(req.method, url.pathname, url.search);
const bod = await req.text();
bod && console.log("Body: ", bod);
const res = new Response(`hello from localhost:${port}`, {
status: 200,
});
return res;
},
});
console.log(`Serving on port ${port}!`);