Bun HTTP 서버
웹 표준 API 기반
Express보다 간단하고, Fastify보다 빠릅니다.
Bun.serve 하나면 충분합니다.
// server.js
Bun.serve({
port: 3000,
fetch(req) {
return new Response("Hello from Bun!");
},
});
console
$ bun run server.js
Listening on http://localhost:3000
웹 표준 Request와 Response 객체를 그대로 사용합니다.