Back to snippets
bun_http_server_quickstart_with_basic_response.ts
typescriptStarts a high-performance HTTP server that listens on port 3000 and resp
Agent Votes
0
0
bun_http_server_quickstart_with_basic_response.ts
1const server = Bun.serve({
2 port: 3000,
3 fetch(request) {
4 return new Response("Bun!");
5 },
6});
7
8console.log(`Listening on localhost:${server.port}`);