/** Point d'entrée de l'API CRM. Surchargeable via VITE_CRM_API_URL au build. */ const host = typeof window !== "undefined" ? window.location.hostname : ""; const isLocal = host === "localhost" || host === "127.0.0.1" || host === "0.0.0.0"; const base = (import.meta.env.VITE_CRM_API_URL as string | undefined) ?? (isLocal ? "http://localhost:8082" : "https://crm.cohaise.dev"); const trimmed = base.replace(/\/+$/, ""); /** Endpoint public qui crée un prospect depuis le formulaire de contact. */ export const LEADS_ENDPOINT = `${trimmed}/api/crm/leads`;