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

@@ -18,11 +18,11 @@ export function getApi(Astro: TAstro, options: Options = { mode: "static" }) {
}
let app: App;
export function serve(config: CreateAppConfig) {
export function serve(config: CreateAppConfig & { beforeBuild?: (app: App) => Promise<void> }) {
return async (args: TAstro) => {
if (!app) {
app = App.create(config);
await config.beforeBuild?.(app);
await app.build();
}
return app.fetch(args.request);