frontAnswerer/lib/utils/defineDomain.ts

18 lines
751 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//Есть четыре стула.
//Публикация на домене нашего прода или стейджинга публикации
//Публикация на чьём-то чужом домене. В этом случае мы шлём запросы на домен публикации.
//Публикация на локалхост. Там шлём на прод
let domain = "https://hbpn.link";
const currentDomain = location.hostname;
const isProduction = !(
currentDomain === "s.hbpn.link" ||
currentDomain.includes("localhost") ||
currentDomain.includes("127.0.0.1")
);
//туризм больше не в исключениях
if (!isProduction) domain = "https://s.hbpn.link";
export { domain, isProduction };