Add logging with Winston

This commit is contained in:
Hannah dagemark 2026-09-15 11:34:39 +02:00
commit 9293c92e58
8 changed files with 357 additions and 25 deletions

View file

@ -1,3 +1,5 @@
import logger from "@/lib/logging/logger";
const BACKEND_URL = process.env.BACKEND_URL;
export async function POST(request: Request) {
@ -6,7 +8,7 @@ export async function POST(request: Request) {
username: indata.username,
password: indata.password,
});
console.log(`recieved users/login call with data: ${body}`);
logger.log("debug", `recieved users/login call with data: ${body}`); // for debugging login form calls
const response = await fetch(`${BACKEND_URL}/users/auth`, {
method: "POST",
body: body,
@ -17,8 +19,6 @@ export async function POST(request: Request) {
const data = await response.json();
console.log(`Recieved data from user auth fetch data as ${data}`);
return Response.json(data, {
status: response.status,
});