Fix frontend unable to load weather data by using relative API URL
NEXT_PUBLIC_API_URL was only set at runtime via k8s ConfigMap, but Next.js inlines NEXT_PUBLIC_* vars at build time. The fallback localhost:8080 URL was baked into the JS bundle, causing all browser requests to fail. Changed default to relative /api/v1 which routes correctly through the Ingress. Also updates Dockerfile ENV syntax and k8s frontend port to 8080. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
APIError,
|
||||
} from './types'
|
||||
|
||||
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8080/api/v1'
|
||||
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || '/api/v1'
|
||||
|
||||
class APIClient {
|
||||
private baseURL: string
|
||||
|
||||
Reference in New Issue
Block a user