I have deployed my frontend and backend both on GitHub pages. looking to add my backend URL to my frontend environments not working. the frontend login screen shows up but can’t login with out my backend running with it. I know I have to add it somewhere in the environment variables but have never done it before on GitHub.
2
Answers
what I had to do was host my frontend not on github pages (as it is only for static websites meaning no backend) but on netlify and my backend on a site like render that can run node backend with a run script of npm start. Then I had to get my URL given to me by render and add it to my environments in netlify to link them together.
use config.js file.
github pages does not support adding env variables directly. you can add this config file to your app to use the env varibles.