<configuration>
<appSettings>
<add key="REACT_APP_SERVER_URL" value="http://hostname.api" />
</appSettings>
</configuration>
I have added the REACT_APP_SERVER_URL env key in the web.config file and the React App is hosted on the IIS manager. I did a console.log(process.env.REACT_APP_SERVER_URL)
in React to read the value of this key but I always get back the value of undefined.
I have also hosted a Node Express server on the same IIS manager instance and the environment variables works fine there. I am not sure if this is a React issue or IIS manager issue, can someone assist me? Thanks.