Created
May 25, 2020 06:58
-
-
Save SahanAmarsha/892f08fd5d0c7969729219526910caab to your computer and use it in GitHub Desktop.
Fetching data using environment variables in React front-end
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const response = await fetch( | |
`${process.env.REACT_APP_BACKEND_URL}/mern/`, | |
{ | |
method: 'GET', | |
headers:{ | |
'Content-Type': 'application/json' | |
}, | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment