We want the staging frontend to send requests to the staging backend rather than the prod backend
The way I've implemented this to look for an environment variable to signal we are in the staging environment
For Next.js, this must be done through a .env file (setting variable via command line doesn't seem to work)
I've added a build step in the Github workflow to create this .env file in CI/CD if pushing to the dev branch (not sure if this is the best solution/janky)
.env
file (setting variable via command line doesn't seem to work).env
file in CI/CD if pushing to thedev
branch (not sure if this is the best solution/janky)