From 24dd564c641a858a3c0153f48c42dff0781648dd Mon Sep 17 00:00:00 2001 From: Carlos Cortizas <97907068+CarlosCortizasCT@users.noreply.github.com> Date: Fri, 14 Jun 2024 10:16:41 +0200 Subject: [PATCH] Fix Playground Custom Application deployment previews (#3546) * fix(playground): use deployment preview url * fix(playground): use deployment preview url * refactor(playground): update custom app config --- playground/custom-application-config.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/playground/custom-application-config.mjs b/playground/custom-application-config.mjs index 9fbb92ca6e..75b6e451b1 100644 --- a/playground/custom-application-config.mjs +++ b/playground/custom-application-config.mjs @@ -1,6 +1,10 @@ import { PERMISSIONS, entryPointUriPath } from './src/constants'; const name = 'AppKit Playground Application'; +const productionUrl = process.env.VERCEL_ENV !== 'production' && Boolean(process.env.VERCEL_URL) ? + `https://${process.env.VERCEL_URL}` : + process.env.APP_URL; + /** * @type {import('@commercetools-frontend/application-config').ConfigOptionsForCustomApplication} */ @@ -19,7 +23,7 @@ const config = { }, production: { applicationId: '${env:APP_ID}', - url: '${env:APP_URL}', + url: productionUrl, }, }, additionalEnv: {