Boolean Art logo

Boolean Art

Subscribe
Archives
April 2, 2025

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:
GitHub X Facebook LinkedIn Boolean Art
This email brought to you by Buttondown, the easiest way to start and grow your newsletter.