Skip to main content
This starts an HTTP server listening on port 3000. It responds to all requests with a Response with status 200 and body "Welcome to Bun!". See Bun.serve for details.
https://mintcdn.com/bun-1dd33a4e/Hq64iapoQXHbYMEN/icons/typescript.svg?fit=max&auto=format&n=Hq64iapoQXHbYMEN&q=85&s=c6cceedec8f82d2cc803d7c6ec82b240server.ts
const server = Bun.serve({
	port: 3000,
	fetch(request) {
		return new Response('Welcome to Bun!');
	},
});

console.log(`Listening on ${server.url}`);