Files
edr-platform/apps/edr-freight-web/backoffice/src/constants/apiConfig.ts
Dagimassefa b3bfa899f5 update
2026-06-22 12:29:48 +03:00

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$/, "");