Setup NEXT_PUBLIC_BASE_URL π
No, its not a placeholder, I did mean to say NEXT_PUBLIC_BASE_URL π
A lot of advanced features on a website depend upon the full canonical url of your site including the domain used for deployment. For this purpose setting up a variable that gives you your site base url can greatly simplify your code.
During development we want
http - localhost:3000
For preview environment we want
https - generated_preview_url
For production we want
https - domain_for_production
Full guide with VERCEL (free community resource) πΊπ»
Setup a BASE_URL for client and server
Lesson from "Professional NextJS": Setup a BASE_URL for client and server
Don't miss what's next. Subscribe to Boolean Art: