Files
bknd/app/src/adapter/remix/remix.adapter.ts
T
2024-12-24 09:43:16 +01:00

15 lines
397 B
TypeScript

import { type FrameworkBkndConfig, createFrameworkApp } from "adapter";
import type { App } from "bknd";
export type RemixBkndConfig = FrameworkBkndConfig;
let app: App;
export function serve(config: RemixBkndConfig = {}) {
return async (args: { request: Request }) => {
if (!app) {
app = await createFrameworkApp(config);
}
return app.fetch(args.request);
};
}