reactjs – Is there a way to set up a React client to access a development backend using links for a production backend?

I have a React app which accesses a Firebase backend. Part of this app is a QR code feature that will link to some dynamically generated content. The QR codes have been pre-generated and are already in distribution. However, the app is getting big enough where it is not practical for me to generate new QR links every time I want to test the feature without disrupting existing data or introducing some bad data into the database/storage bucket.

So what I would like to do is set up a development backend on my machine say at 192.168.0.x:3000 and have the client access that backend when in development mode. Is this a common problem and are there established design patterns for this? Is it possible to configure webpack to make a ‘production build’ which reads QR links as-is and then a ‘QA build’ which will replace mydomain.ca with 192.168.0.x:3000 when QR links are read? Or, is there a way for me to force my device to just point mydomain.ca to the local IP?

I apologize if this is a drawn out way of explaining this but I’m a one man show over here.

Read more here: Source link