Files
coolify-examples/bun/index.ts
Andras Bacsai d83b3c0b62 init 🌮
2024-03-04 14:07:59 +01:00

11 lines
364 B
TypeScript

const PORT = process.env.PORT || 3000;
Bun.serve({
port: PORT,
fetch(req) {
const url = new URL(req.url);
if (url.pathname === "/") return new Response("Home page!");
if (url.pathname === "/blog") return new Response("Blog!");
return new Response("404!");
},
})
console.log(`Server running at http://localhost:${PORT}`);