updated examples: astro, nextjs, remix, bun, node

This commit is contained in:
dswbx
2024-12-23 16:50:26 +01:00
parent a17fd2df67
commit 70e42a02d7
31 changed files with 319 additions and 35 deletions

View File

@@ -1,10 +1,11 @@
import { App, type CreateAppConfig } from "bknd";
let app: App;
export function serve(config: CreateAppConfig) {
export function serve(config: CreateAppConfig & { beforeBuild?: (app: App) => Promise<void> }) {
return async (args: { request: Request }) => {
if (!app) {
app = App.create(config);
await config.beforeBuild?.(app);
await app.build();
}
return app.fetch(args.request);