R
Railway8mo ago
Jed

Next.js private database URL

I am deploying a Next.js app on Railway, where I also have a database hosted. On my home page '/', I make a database call. In production, I am using a private URL for the database to reduce network usage. However, when Next.js is building, it is trying to prerender the page and the private URL hasnt initialised yet, causing the build to fail. Is there a way around to fix this to continue using the private URL, or do I need to use the public one?
3 Replies
Percy
Percy8mo ago
Project ID: 694c9ef5-c76e-4b0c-8f1f-bcd781caf44e
Jed
JedOP8mo ago
694c9ef5-c76e-4b0c-8f1f-bcd781caf44e
Brody
Brody8mo ago
I think you can set the public database URL as the direct URL and the private database url as the normal URL, or vice versa
Want results from more Discord servers?
Add your server