Compare commits

...

3 Commits

Author SHA1 Message Date
djalim eb88e7b038 Merge branch 'develop' into release/1.0.1
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
2026-05-05 12:51:33 +00:00
djalim e719e5129f feat: added logs
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-05 14:50:17 +02:00
djalim 08894730a3 refactor(fresh.config): change server port to 80 and remove cert/key
Build and push image / Check Deno code (push) Successful in 6s
Build and push image / Build Docker image (push) Successful in 1m0s
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
2026-05-01 20:30:02 +02:00
2 changed files with 23 additions and 3 deletions
+1 -3
View File
@@ -6,8 +6,6 @@ await load({ envPath: "./.env", export: true });
await ensureDatabases();
export default defineConfig({
server: {
cert: await Deno.readTextFile("certs/cert.pem"),
key: await Deno.readTextFile("certs/key.pem"),
port: 443,
port: 80,
},
});
+22
View File
@@ -43,6 +43,28 @@ export function getKey(user: string): string {
}
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.
* @param request The HTTP incomming request.