Commit 8708d8cd authored by Lê Bảo Hồng Đức's avatar Lê Bảo Hồng Đức

[tag]staging

parent 9a9e5bb9
Pipeline #50603 failed with stages
in 3 minutes and 30 seconds
const DEFAULT_BACKEND_ORIGIN = "https://vietprodev.duckdns.org/gateway/vcci-news-backend"; const DEFAULT_BACKEND_ORIGIN = "https://vietprodev.duckdns.org/gateway/vcci-news-backend";
const DEFAULT_FRONTEND_ORIGIN = "https://vccihcm.vn";
const normalizeOrigin = (value?: string | null) => value?.trim().replace(/\/+$/, "") || ""; const normalizeOrigin = (value?: string | null) => value?.trim().replace(/\/+$/, "") || "";
...@@ -12,6 +13,9 @@ const readOrigin = (key: "NEXT_PUBLIC_BACKEND_HOST" | "NEXT_PUBLIC_FRONTEND_HOST ...@@ -12,6 +13,9 @@ const readOrigin = (key: "NEXT_PUBLIC_BACKEND_HOST" | "NEXT_PUBLIC_FRONTEND_HOST
if (key === "NEXT_PUBLIC_BACKEND_HOST" && process.env.NODE_ENV === "production") { if (key === "NEXT_PUBLIC_BACKEND_HOST" && process.env.NODE_ENV === "production") {
return DEFAULT_BACKEND_ORIGIN; return DEFAULT_BACKEND_ORIGIN;
} }
if (key === "NEXT_PUBLIC_FRONTEND_HOST" && process.env.NODE_ENV === "production") {
return DEFAULT_FRONTEND_ORIGIN;
}
if (typeof window !== "undefined" && key === "NEXT_PUBLIC_FRONTEND_HOST") { if (typeof window !== "undefined" && key === "NEXT_PUBLIC_FRONTEND_HOST") {
return normalizeOrigin(window.location.origin); return normalizeOrigin(window.location.origin);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment