I was trying to pass config variables from a backend written in Go to a single page app (SPA) written in react. For example, I wanted to set an "Env" flag to dev
or prod
or control whether you have to log in or not. Here's an example of the /api/config
route that supplies this data:
{
"Auth0ClientDomain": "odewahn.auth0.com",
"Auth0ClientID": "gcSxq9GfpUdVWNIvYiOsP7rh1s8u6ftA",
"ClientBrowser": "HTTPie",
"ClientOS": "darwin",
"Env": "dev",
"FirstClientLoad": "true",