Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming SSR: Fix RWJS_EXP_SSR_GRAPHQL_ENDPOINT logic #9134

Merged
merged 2 commits into from
Sep 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/vite/src/streaming/registerGlobals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export const registerFwGlobals = () => {
return apiPath
} else {
const proxiedApiUrl =
// NOTE: rwConfig.web.host defaults to "localhost", which is
// troublesome in regards to IPv6/IPv4. So all the more
// reason to set RWJS_EXP_SSR_GRAPHQL_ENDPOINT
'http://' + rwConfig.web.host + ':' + rwConfig.web.port + apiPath

if (
Expand All @@ -52,7 +55,7 @@ export const registerFwGlobals = () => {
console.warn()

console.warn(
'You can override this for by setting RWJS_EXP_SSR_GRAPHQL_ENDPOINT in your environment vars'
'You can override this for SSR by setting RWJS_EXP_SSR_GRAPHQL_ENDPOINT in your environment vars'
)
console.warn()

Expand All @@ -62,7 +65,7 @@ export const registerFwGlobals = () => {
}

return (
proxiedApiUrl || (process.env.RWJS_EXP_SSR_GRAPHQL_ENDPOINT as string)
(process.env.RWJS_EXP_SSR_GRAPHQL_ENDPOINT as string) ?? proxiedApiUrl
)
}
})(),
Expand Down
Loading