Skip to content

Commit 8f9fc82

Browse files
committed
Update CORS allowed origins and configure backend URL from environment variable
1 parent 95917ba commit 8f9fc82

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

backend/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ app:
1919
script: ./AI/analyze.py
2020

2121
cors:
22-
allowed-origins: "http://localhost:3000"
22+
allowed-origins: "http://localhost:3000, https://apex-grid-transformer-tracker.vercel.app"

frontend/lib/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Prefer env, fallback to local; ensure protocol is present.
2-
const raw = ("http://localhost:8080").trim().replace(/\/$/, "");
2+
const raw = (process.env.NEXT_PUBLIC_BACKEND_URL || "http://localhost:8080").trim().replace(/\/$/, "");
33
export const API_BASE = raw.startsWith("http://") || raw.startsWith("https://") ? raw : `http://${raw}`;
44

55
export const apiUrl = (path: string) => `${API_BASE}${path.startsWith('/') ? '' : '/'}${path}`;

0 commit comments

Comments
 (0)