From a6190ae40d15b9187c89329465d42e9f4c3b5f0f Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:50:49 +0700 Subject: [PATCH] update: Add support for Netlify, Cloudflare, Railway, and Render --- src/constant.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/constant.ts b/src/constant.ts index 19c809a..21aa513 100644 --- a/src/constant.ts +++ b/src/constant.ts @@ -18,7 +18,15 @@ export const USE_CACHE = false; */ export const BASE_URL = process.env.NODE_ENV === "production" - ? process.env.NEXT_PUBLIC_DOMAIN ?? process.env.VERCEL_PROJECT_PRODUCTION_URL ?? process.env.VERCEL_URL ?? "" + ? process.env.NEXT_PUBLIC_DOMAIN ?? + process.env.VERCEL_PROJECT_PRODUCTION_URL ?? + process.env.VERCEL_URL ?? + process.env.URL ?? // Netlify + process.env.DEPLOY_URL ?? // Netlify + process.env.CF_PAGES_URL ?? // Cloudflare Pages + process.env.RAILWAY_PUBLIC_DOMAIN ?? // Railway + process.env.RENDER_EXTERNAL_HOSTNAME ?? // Render + "you-need-to-set-the-domain.com" // Fallback to prevent build error : "http://localhost:3000"; /** @@ -41,4 +49,4 @@ export const COOKIES_OPTIONS = { /** * On this paths, navbar and footer will not be rendered */ -export const NO_LAYOUT_PATHS = [/\/_\/embed\//g]; +export const NO_LAYOUT_PATHS = [/\/ngdi-internal\/embed\//g];