fix(backend): CORS and API URL fixes
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user