Add integration tests for auth, improve auth middleware and cookies handling

This commit is contained in:
dswbx
2025-01-11 10:52:31 +01:00
parent 0d945ab45b
commit c732566f63
7 changed files with 276 additions and 54 deletions

View File

@@ -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);
}