Skip to content

Commit

Permalink
Merge pull request #22 from sanity-io/next-13
Browse files Browse the repository at this point in the history
fix prod url
  • Loading branch information
SimeonGriggs committed Jun 22, 2023
2 parents d04d88f + 3f83513 commit a36c5de
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions studio/structure/resolvePreviewUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ export default async function resolvePreviewUrl(doc: SanityDocument, client: San
// Use public vars because Studio is all client-side
if (process.env.SANITY_STUDIO_VERCEL_ENV) {
// This is the URL of the Studio deployment, not the web deployment
baseUrl = `https://${
baseUrl =
process.env.SANITY_STUDIO_VERCEL_ENV === 'production'
? process.env.SANITY_STUDIO_VERCEL_URL?.replace(`-studio`, ``)
? `https://demo-course-platform.sanity.build`
: // This should work, but doesn't
// the env seems to be `undefined` in vercel
// : process.env.SANITY_STUDIO_VERCEL_BRANCH_URL
// So I'm DIY-ing a branch URL for the web deployment
`demo-course-platform-git-${process.env.SANITY_STUDIO_VERCEL_GIT_COMMIT_REF}.sanity.build`
}`
`https://demo-course-platform-git-${process.env.SANITY_STUDIO_VERCEL_GIT_COMMIT_REF}.sanity.build`

console.log({baseUrl})
}
Expand Down

2 comments on commit a36c5de

@vercel
Copy link

@vercel vercel bot commented on a36c5de Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

demo-course-platform-studio – ./studio

demo-course-platform-studio-git-main.sanity.build
demo-course-platform-studio.sanity.build

@vercel
Copy link

@vercel vercel bot commented on a36c5de Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

demo-course-platform – ./web

demo-course-platform.sanity.build
demo-course-platform-git-main.sanity.build

Please sign in to comment.