After some dinking around with the frontend I've come to understand why embedding the environment variables into the NextJS app is necessary (for now).
This is because NextJS builds a static set of JS pages and then serves those to the end-user (web browser).
At-present, the pages are served via yarn. This is technically incorrect to package and serve content this way as yarn is just a dev tool with many dev hooks and handles embedded in the content for debugging.
Instead, we should be using a WSGI library to have the "back" of the frontend serving via our own minimized WSGI code. With this, we should be able to pull any environment variables we need and adjust the content that gets served (content with calls to the api url) and be able to properly and dynamically serve the right content.
After some dinking around with the frontend I've come to understand why embedding the environment variables into the NextJS app is necessary (for now).
This is because NextJS builds a static set of JS pages and then serves those to the end-user (web browser).
At-present, the pages are served via
yarn. This is technically incorrect to package and serve content this way asyarnis just a dev tool with many dev hooks and handles embedded in the content for debugging.Instead, we should be using a WSGI library to have the "back" of the frontend serving via our own minimized WSGI code. With this, we should be able to pull any environment variables we need and adjust the content that gets served (content with calls to the api url) and be able to properly and dynamically serve the right content.