fix(backend): CORS and API URL fixes

This commit is contained in:
2025-07-31 14:52:27 +01:00
parent 4a1c67022d
commit cbd16b3f60

View File

@@ -9,7 +9,11 @@ import type {
SubmissionResponse, SubmissionResponse,
} from "@/types"; } from "@/types";
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000"; // Server-side uses internal Docker network, client-side uses public URL
const API_BASE_URL =
typeof window === "undefined"
? process.env.API_URL || "http://localhost:8000"
: process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000";
export class ApiError extends Error { export class ApiError extends Error {
constructor( constructor(