Answers for "react environment"

3

react environment

create .env file in root directory
in this file create envirement variable starting with REACT_APP..
example : REACT_APP_BACKEND_URL = http://localhost:5000/

call it in your react app like this process.env.REACT_APP_BACKEND_URL

N.B if your app is running and you wanna add those lines you must shutdown
the app and run it again it will work as charm
Posted by: Guest on April-18-2022

Code answers related to "react environment"

Code answers related to "Javascript"

Browse Popular Code Answers by Language