Skip to content

Commit 8c25b04

Browse files
committed
fix: fix: remove hardcoded endpoints
User should provide live-preview host region specific endpoints
1 parent 8d3779f commit 8c25b04

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/lib/contentstack.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ export function stack(config: StackConfig): StackClass {
4242

4343
if (config.live_preview?.enable === true) {
4444
if (config.live_preview?.management_token != null && config.live_preview?.preview_token == null) {
45-
config.host = 'api.contentstack.io'
46-
config.live_preview.host = config.host
45+
config.host = config.live_preview.host
4746
} else if (config.live_preview?.preview_token != null && config.live_preview?.management_token == null) {
48-
config.host = 'rest-preview.contentstack.com'
49-
config.live_preview.host = config.host
47+
config.host = config.live_preview.host
5048
}
5149
} else {
5250
defaultConfig.defaultHostname = config.host ? config.host : getHost(config.region, config.host);

0 commit comments

Comments
 (0)