@zeltjs/adapter-bun
v0.13.0
Published
Bun adapter for the Zelt framework
Readme
@zeltjs/adapter-bun
Bun runtime adapter for Zelt applications.
Installation
bun add @zeltjs/adapter-bun @zeltjs/coreUsage
import { createApp, http, Controller, Get, httpServer } from '@zeltjs/core';
import { onBun } from '@zeltjs/adapter-bun';
@Controller('/hello')
class HelloController {
@Get('/')
greet() {
return { message: 'Hello from Bun!' };
}
}
const app = createApp([httpServer(), http({ controllers: [HelloController] })]);
const bunApp = await onBun(app);
await bunApp.httpServer.listen(bunApp.http, { port: 3000 });Server handles provide address, closed, and shutdown(). Shutdown follows Bun's native graceful stop: it refuses new TCP connections, while already accepted keep-alive connections may remain usable until the client closes them.
