Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3fa0e26bd1 | |||
| 8fc4dc09c9 |
+1
-14
@@ -11,20 +11,7 @@ export type HostMatch =
|
|||||||
| { kind: "unknown" };
|
| { kind: "unknown" };
|
||||||
|
|
||||||
// Longest-first so `stage.breakpilot.com` is matched before `breakpilot.com`.
|
// Longest-first so `stage.breakpilot.com` is matched before `breakpilot.com`.
|
||||||
// Built-ins cover dev (localhost) + the canonical breakpilot.com targets.
|
const APEX_HOSTS = ["stage.breakpilot.com", "breakpilot.com", "localhost"];
|
||||||
// PORTAL_APEX_HOSTS is a comma-separated env override for per-environment
|
|
||||||
// hosts (e.g. portal-dev.meghsakha.com while breakpilot.com isn't registered).
|
|
||||||
const APEX_HOSTS = (() => {
|
|
||||||
const base = ["stage.breakpilot.com", "breakpilot.com", "localhost"];
|
|
||||||
const extra = (process.env.PORTAL_APEX_HOSTS ?? "")
|
|
||||||
.split(",")
|
|
||||||
.map((h) => h.trim().toLowerCase())
|
|
||||||
.filter(Boolean);
|
|
||||||
// Longest-first to keep the suffix-strip loop correct.
|
|
||||||
return Array.from(new Set([...extra, ...base])).sort(
|
|
||||||
(a, b) => b.length - a.length,
|
|
||||||
);
|
|
||||||
})();
|
|
||||||
const APEX_SET = new Set(APEX_HOSTS);
|
const APEX_SET = new Set(APEX_HOSTS);
|
||||||
|
|
||||||
export function parseHost(host: string | null | undefined): HostMatch {
|
export function parseHost(host: string | null | undefined): HostMatch {
|
||||||
|
|||||||
Reference in New Issue
Block a user