Skip to content

Commit

Permalink
Use NEXT_PUBLIC_SERVER_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Oct 30, 2023
1 parent 2afa804 commit 45597ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/app-config/backendConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export type VeniceInput = PipelineInput<
export const contextFactory = getContextFactory({
providers: Object.values(mergedIntegrations),
// routerUrl: 'http://localhost:3010/api', // apiUrl?
// TODO: Rename to just serverUrl as we will need it for redirects and everything else
apiUrl: joinPath(getServerUrl(null), '/api/trpc'),
env,
jwtSecret: env.JWT_SECRET_OR_PUBLIC_KEY,
Expand Down
3 changes: 3 additions & 0 deletions apps/app-config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export function getServerUrl(req: GetServerSidePropsContext['req'] | null) {
`${window.location.protocol}//${window.location.host}`) ||
(req &&
`${req.headers['x-forwarded-proto'] || 'http'}://${req.headers.host}`) ||
(process.env['NEXT_PUBLIC_SERVER_URL']
? process.env['NEXT_PUBLIC_SERVER_URL']
: null) ||
(process.env['VERCEL_URL']
? 'https://' + process.env['VERCEL_URL']
: null) ||
Expand Down

1 comment on commit 45597ca

@vercel
Copy link

@vercel vercel bot commented on 45597ca Oct 30, 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:

venice – ./

usevenice.vercel.app
app.venice.is
venice-venice.vercel.app
venice-git-production-venice.vercel.app

Please sign in to comment.