mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
fix: add modes export, fix event firing with modes and cloudflare
This commit is contained in:
@@ -37,19 +37,19 @@ export async function createApp<Env extends CloudflareEnv = CloudflareEnv>(
|
||||
config: CloudflareBkndConfig<Env> = {},
|
||||
ctx: Partial<CloudflareContext<Env>> = {},
|
||||
) {
|
||||
const appConfig = await makeConfig(
|
||||
const appConfig = await makeConfig(config, ctx);
|
||||
return await createRuntimeApp<Env>(
|
||||
{
|
||||
...config,
|
||||
...appConfig,
|
||||
onBuilt: async (app) => {
|
||||
if (ctx.ctx) {
|
||||
registerAsyncsExecutionContext(app, ctx?.ctx);
|
||||
}
|
||||
await config.onBuilt?.(app);
|
||||
await appConfig.onBuilt?.(app);
|
||||
},
|
||||
},
|
||||
ctx,
|
||||
ctx?.env,
|
||||
);
|
||||
return await createRuntimeApp<Env>(appConfig, ctx?.env);
|
||||
}
|
||||
|
||||
// compatiblity
|
||||
|
||||
@@ -158,6 +158,7 @@ export async function makeConfig<Env extends CloudflareEnv = CloudflareEnv>(
|
||||
sessionHelper.set(c, session);
|
||||
await next();
|
||||
});
|
||||
appConfig.options?.manager?.onServerInit?.(server);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user