13 lines
304 B
TypeScript
13 lines
304 B
TypeScript
import { App, type CreateAppConfig } from "../../App";
|
|
|
|
let app: App;
|
|
export function serve(config: CreateAppConfig) {
|
|
return async (args: { request: Request }) => {
|
|
if (!app) {
|
|
app = App.create(config);
|
|
await app.build();
|
|
}
|
|
return app.fetch(args.request);
|
|
};
|
|
}
|