diff --git a/src/settings.ts b/src/settings.ts index 65c73581..416ebcc6 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -10,24 +10,11 @@ const env = import.meta.env as Record export default env // The name of the current service. -export const SERVICE_NAME = env.VITE_SERVICE_NAME ?? "replace-me" - -// If the current service the root service. This will only be true for portal. -export const SERVICE_IS_ROOT = Boolean(Number(env.VITE_SERVICE_IS_ROOT ?? "0")) - -// The protocol, domain and port of the current service. -export const SERVICE_PROTOCOL = env.VITE_SERVICE_PROTOCOL ?? "http" -export const SERVICE_DOMAIN = env.VITE_SERVICE_DOMAIN ?? "localhost" -export const SERVICE_PORT = Number(env.VITE_SERVICE_PORT ?? "8000") - -// The base url of the current service. -// The root service does not need its name included in the base url. -export const SERVICE_BASE_URL = - `${SERVICE_PROTOCOL}://${SERVICE_DOMAIN}:${SERVICE_PORT}` + - (SERVICE_IS_ROOT ? "" : `/${SERVICE_NAME}`) +export const SERVICE_NAME = env.VITE_SERVICE_NAME ?? "REPLACE_ME" // The api url of the current service. -export const SERVICE_API_URL = `${SERVICE_BASE_URL}/api` +export const SERVICE_API_URL = + env.VITE_SERVICE_API_URL ?? "http://localhost:8000" // The names of cookies. export const CSRF_COOKIE_NAME = `${SERVICE_NAME}_csrftoken`