mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
Add integration tests for auth, improve auth middleware and cookies handling
This commit is contained in:
@@ -33,18 +33,22 @@ if (run_example) {
|
||||
initialConfig = config;
|
||||
}
|
||||
|
||||
let app: App;
|
||||
const recreate = true;
|
||||
export default {
|
||||
async fetch(request: Request) {
|
||||
const app = App.create({ connection, initialConfig });
|
||||
app.emgr.onEvent(
|
||||
App.Events.AppBuiltEvent,
|
||||
async () => {
|
||||
app.registerAdminController({ forceDev: true });
|
||||
app.module.server.client.get("/assets/*", serveStatic({ root: "./" }));
|
||||
},
|
||||
"sync"
|
||||
);
|
||||
await app.build();
|
||||
if (!app || recreate) {
|
||||
app = App.create({ connection, initialConfig });
|
||||
app.emgr.onEvent(
|
||||
App.Events.AppBuiltEvent,
|
||||
async () => {
|
||||
app.registerAdminController({ forceDev: true });
|
||||
app.module.server.client.get("/assets/*", serveStatic({ root: "./" }));
|
||||
},
|
||||
"sync"
|
||||
);
|
||||
await app.build();
|
||||
}
|
||||
|
||||
return app.fetch(request);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user