Skip to content

Commit 3bdc06f

Browse files
Updated the Graphql Host for Kickstart Graphql app
1 parent ac45fb0 commit 3bdc06f

File tree

1 file changed

+7
-2
lines changed
  • packages/contentstack-bootstrap/src/bootstrap

1 file changed

+7
-2
lines changed

packages/contentstack-bootstrap/src/bootstrap/utils.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,17 @@ const envFileHandler = async (
190190
if (regionName !== 'eu' && !isUSRegion) {
191191
customHost = region?.cma?.substring(8);
192192
}
193+
let graphqlHost = "graphql.contentstack.com";
194+
if(regionName != 'na'){
195+
graphqlHost = `${regionName}-.graphql.contentstack.com`;
196+
}
197+
193198

194199
// Construct image hostname based on the actual host being used
195200
let imageHostname = '*-images.contentstack.com'; // default fallback
196201
if (region?.cda) {
197202
const baseHost = region.cda.replace(/^https?:\/\//, '').replace(/^[^.]+\./, '');
198-
imageHostname = `*-images.${baseHost}`;
203+
imageHostname = `images.${baseHost}`;
199204
}
200205
const production = environmentVariables.environment === 'production' ? true : false;
201206
switch (appConfigKey) {
@@ -212,7 +217,7 @@ const envFileHandler = async (
212217
}\nNEXT_PUBLIC_CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment
213218
}\nNEXT_PUBLIC_CONTENTSTACK_REGION=${regionName
214219
}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW=${livePreviewEnabled ? 'true' : 'false'
215-
}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_DELIVERY = ${cdnHost
220+
}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_DELIVERY = ${graphqlHost
216221
}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_APPLICATION = ${appHost
217222
}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW_HOST = ${previewHost
218223
}\nNEXT_PUBLIC_CONTENTSTACK_IMAGE_HOSTNAME=${imageHostname}`;

0 commit comments

Comments
 (0)