kunokdev/cra-runtime-environment-variables

Where is `PUBLIC_URL` variable defined?

Closed this issue · 2 comments

I saw the .env file only has API_URL. It did not have any PUBLIC_URL right?
I ran my source code but it got an error GET https://localhost:3000/%PUBLIC_URL%/env-config.js net::ERR_ABORTED 400 (Bad Request).
My source code's using the webpack and do not use CRA, I use react-boiler-plate template, may be the issue comes from the webpack? I don't know

Please, help me out with the issue

You may define any environment variables of your choice, instead of calling it API_URL you may call it PUBLIC_URL, at the end all environment variables become properties of the object that you injected into window.