/** Point d'entrée de l'API CRM. Surchargeable via NEXT_PUBLIC_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 = process.env.NEXT_PUBLIC_CRM_API_URL ?? (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`;