Search code examples
javascriptreactjsnetlify

How to add .env file & host React app in Netlify?


I have a React app that is present in GitHub and I want to host it with help with Netlify, where I am not sure where should I place my .env file which contains all the credentials for API


Solution

  • In Netlify, on your product page.

    Go to 'Site Settings' -> 'Build & Deploy' and scroll down to 'Environment'. You can input your env variables here.

    Never upload your .env file to GitHub.