fix(backend): CORS and API URL fixes

This commit is contained in:
2025-07-31 14:52:27 +01:00
parent d6e9a689e3
commit 2f18d3f215

View File

@@ -9,7 +9,11 @@ import type {
SubmissionResponse,
} 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 {
constructor(