mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
13 lines
235 B
TypeScript
13 lines
235 B
TypeScript
import { serve } from "bun";
|
|
|
|
const server = serve({
|
|
fetch(req) {
|
|
return new Response(`Pending requests count: ${this.pendingRequests}`);
|
|
},
|
|
});
|
|
|
|
// Stop the server after 5 seconds
|
|
setTimeout(() => {
|
|
server.stop();
|
|
}, 5000);
|