From ff5133977fb098a4b0159b3176e6d427e0305a63 Mon Sep 17 00:00:00 2001 From: theorr Date: Sat, 13 Dec 2025 03:05:43 +0300 Subject: [PATCH] fix: :443 in links --- frontend/app/config/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/app/config/index.ts b/frontend/app/config/index.ts index 20ffdb7..d07de16 100644 --- a/frontend/app/config/index.ts +++ b/frontend/app/config/index.ts @@ -31,10 +31,16 @@ function loadConfig(): FrontendConfig { const frontendHost = process.env.NEXT_PUBLIC_FRONTEND_HOST || (typeof window !== 'undefined' ? window.location.hostname : 'localhost'); const frontendPort = process.env.NEXT_PUBLIC_FRONTEND_PORT || '3000'; + // Don't include port in URL if it's the default port for the protocol + const isDefaultPort = (frontendProtocol === 'https' && frontendPort === '443') || + (frontendProtocol === 'http' && frontendPort === '80'); + // For Vercel deployments, use VERCEL_URL if available const frontendBaseUrl = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` - : `${frontendProtocol}://${frontendHost}:${frontendPort}`; + : isDefaultPort + ? `${frontendProtocol}://${frontendHost}` + : `${frontendProtocol}://${frontendHost}:${frontendPort}`; return { apiBaseUrl,