Compare commits

..

1 Commits

Author SHA1 Message Date
djalim 951c9c1fea test : changed test format + added playwright support
Check Deno code / Check Deno code (pull_request) Has been cancelled
Tests / Unit tests (pull_request) Has been cancelled
Tests / Integration tests (pull_request) Has been cancelled
Check Deno code / Check Deno code (push) Has been cancelled
Tests / Unit tests (push) Has been cancelled
Tests / Integration tests (push) Has been cancelled
2026-05-03 21:52:02 +02:00
2 changed files with 3 additions and 23 deletions
+3 -1
View File
@@ -6,6 +6,8 @@ await load({ envPath: "./.env", export: true });
await ensureDatabases(); await ensureDatabases();
export default defineConfig({ export default defineConfig({
server: { server: {
port: 80, cert: await Deno.readTextFile("certs/cert.pem"),
key: await Deno.readTextFile("certs/key.pem"),
port: 443,
}, },
}); });
-22
View File
@@ -43,28 +43,6 @@ export function getKey(user: string): string {
} }
export const handler: MiddlewareHandler<State>[] = [ export const handler: MiddlewareHandler<State>[] = [
async function logRequest(
request: Request,
context: FreshContext<State>,
): Promise<Response> {
const url = new URL(request.url);
const start = performance.now();
console.log(`--> ${request.method} ${url.pathname}${url.search}`);
try {
const response = await context.next();
const duration = (performance.now() - start).toFixed(1);
console.log(`<-- ${request.method} ${url.pathname} ${response.status} (${duration}ms)`);
return response;
} catch (error) {
const duration = (performance.now() - start).toFixed(1);
console.error(`<-- ${request.method} ${url.pathname} ERROR (${duration}ms)`);
console.error(error);
throw error;
}
},
/** /**
* Check if user is authenticated and add session to context accordingly. * Check if user is authenticated and add session to context accordingly.
* @param request The HTTP incomming request. * @param request The HTTP incomming request.