mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 05:18:11 +00:00
Muluhabt ERP modules
This commit is contained in:
34
apps/edr-hr-web/src/config/env.ts
Normal file
34
apps/edr-hr-web/src/config/env.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/** Runtime configuration, read once so every consumer sees the same values. */
|
||||
|
||||
const trim = (value: string | undefined, fallback: string) =>
|
||||
(value ?? "").trim() || fallback;
|
||||
|
||||
export const HR_API_URL = trim(
|
||||
import.meta.env.VITE_HR_API_URL,
|
||||
"http://localhost:3005",
|
||||
);
|
||||
|
||||
/**
|
||||
* Where credentials are POSTed. See .env.example — hr-api owns no auth routes,
|
||||
* so this points at whichever service hosts the IAM auth controller.
|
||||
*/
|
||||
export const AUTH_API_URL = trim(
|
||||
import.meta.env.VITE_AUTH_API_URL,
|
||||
"http://localhost:3001",
|
||||
);
|
||||
|
||||
/**
|
||||
* Audience header for the auth host. Required by edr-freight-api's login (it
|
||||
* 403s without one); edr-passenger-api neither reads it nor allows it through
|
||||
* CORS. Left EMPTY by default so the header is simply not sent — set it only
|
||||
* when pointing at an auth host that wants it.
|
||||
*/
|
||||
export const CLIENT_APP = (import.meta.env.VITE_CLIENT_APP ?? "").trim();
|
||||
|
||||
/**
|
||||
* Base path under AUTH_API_URL where the auth controller lives. It is not the
|
||||
* same on every host: edr-freight-api mounts it at `/api/auth/*`, while
|
||||
* edr-passenger-api sets no global prefix and serves `/auth/*`. Making it
|
||||
* configurable means switching auth hosts is two env vars, not a code change.
|
||||
*/
|
||||
export const AUTH_BASE_PATH = (import.meta.env.VITE_AUTH_BASE_PATH ?? "/api").trim();
|
||||
Reference in New Issue
Block a user