3000 端口的 HTTP 服务器。它对所有请求都返回状态为 200、内容为 "Welcome to Bun!" 的 Response。
详情请参阅 Bun.serve。
3000 端口的 HTTP 服务器。它对所有请求都返回状态为 200、内容为 "Welcome to Bun!" 的 Response。
详情请参阅 Bun.serve。
const server = Bun.serve({
port: 3000,
fetch(request) {
return new Response("Welcome to Bun!");
},
});
console.log(`Listening on ${server.url}`);