mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 10:52:53 +00:00
11 lines
405 B
TypeScript
11 lines
405 B
TypeScript
// Accept either a host-only URL or one that already ends with `/api`.
|
|
// The HTTP client appends `/api` itself, so we normalize here to avoid
|
|
// accidental `/api/api/...` requests from env values.
|
|
const rawApiBaseUrl =
|
|
(import.meta.env.VITE_API_URL as string | undefined) ?? "http://localhost:3001";
|
|
|
|
export const API_BASE_URL = rawApiBaseUrl
|
|
.trim()
|
|
.replace(/\/+$/, "")
|
|
.replace(/\/api$/, "");
|