Skip to content

Commit b92f673

Browse files
committed
chore: use env vars for urls
1 parent 288c760 commit b92f673

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

apps/studio/sanity.config.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ const iframes: [IframeOptions['url'], string][] = [
2020
'remix',
2121
].map((title) => [
2222
(document, {perspectiveStack, selectedPerspectiveName}) => {
23-
const url = new URL(`https://preview-kit-${title}.sanity.dev`)
23+
const url = new URL(
24+
title === 'remix'
25+
? process.env.SANITY_STUDIO_REMIX_URL || 'http://localhost:3000'
26+
: title === 'next-pages-router'
27+
? process.env.SANITY_STUDIO_PAGES_ROUTER_URL || 'http://localhost:3003'
28+
: title === 'next-app-router'
29+
? process.env.SANITY_STUDIO_APP_ROUTER_URL || 'http://localhost:3002'
30+
: 'https://example.com',
31+
)
2432
if (perspectiveStack.length > 0) {
2533
url.searchParams.set('sanity-preview-perspective', perspectiveStack.join(','))
2634
} else if (typeof selectedPerspectiveName === 'string') {

0 commit comments

Comments
 (0)