I am building a react website with firebase functions backend.
I'm using firebase serve to locally host the node.js backend, and I am using npm start to test my react webapp.
all my get requests in my react app use /some endpoint to communicate with the server. But they are locally hosted on different ports. firebase serves it on localhost:5000 while react live server hosts it at localhost:3000.
I tried many things and couldn't get any useful way to make this work. I at last added my react project as a subfolder in my firebase project and made the hosting public path at firebase.json to my react build directory. It works now but I always have to run npm run build on my react app on every change, to make it compile my app into the build directory, which is painfully slow.
What is the proper way to do this? debug react app and firebase backend together.
Aucun commentaire:
Enregistrer un commentaire