How to redirect PWA to new server after being opened?

this is my first post here.
I’m working on a group school project and made a PWA which is hosted on an external Cloudflare server with a certificate. For the duration of testing, the PWA sent data to that server through NodeJS. Now, after installing the PWA on a mobile device, I would like it to communicate with another server instead, a Raspberry PI with a fixed IP acting as a Wifi hotspot in order for the PWA to send data in the database it’s hosting, and effectively only keep the original server as the server that permits downloading and installing the PWA on devices.

Now my issue is, when I change the NodeJS code in the PWA to indicate which server it’s supposed to establish a connection with, the PWA still communicates with the server hosting it instead of contacting the new server. I tried changing the ip address and port in the PWA’s NodeJS code to indicate the new server it’s supposed to send data to, but when testing, it still sends its data to the host server instead of establishing a new connection to the rpi server.

All help is appreciated.