diff --git a/src/lib/api.ts b/src/lib/api.ts index 7f159e1..9d60654 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -2,7 +2,7 @@ * API client for Team Board BFF. */ -const API_BASE = process.env.NEXT_PUBLIC_API_URL || "https://team.uix.su"; +const API_BASE = process.env.NEXT_PUBLIC_API_URL!; // Required — set in .env.local function getToken(): string | null { if (typeof window === "undefined") return null; diff --git a/src/lib/ws.ts b/src/lib/ws.ts index aa9cf07..746260b 100644 --- a/src/lib/ws.ts +++ b/src/lib/ws.ts @@ -22,7 +22,11 @@ class WSClient { const token = localStorage.getItem("tb_token"); if (!token) return; - const wsBase = process.env.NEXT_PUBLIC_WS_URL || "wss://team.uix.su"; + const wsBase = process.env.NEXT_PUBLIC_WS_URL; + if (!wsBase) { + console.error("NEXT_PUBLIC_WS_URL is not set!"); + return; + } this.ws = new WebSocket(`${wsBase}/ws?token=${token}`); this.ws.onmessage = (event) => {