Changing wifi networks

I want to write an app in appstudio as a web app, probably PWA. I want to use the same process that many devices use to add themselves to the local wifi network. This means the device, in this case an ESP32, but could be anything, will start out prior to setup with a hot spot and a web page that will allow the user to enter the local wifi ssid and password.

The ESP32 would then shut down the HotSpot and then connect to the local wifi. Verify it works.

At this point, I need to know what the IP that was given to the ESP32. One way was go to back to the hotspot and provide the info there. I’lll need to work that part out. Maybe a static IP.

I was wondering if the user, who is prompted to change the wifi to our ESP32 hotspot, will the original PWA continue to operate and allow me to do AJAX calls on the new network.

And, if the ESP32 device stops sending the hotspot, I assume that most devices running my appstudio app would go back and reconnect to the original local wifi.

Any ideas on if the transition of wifi networks may affect my PWA web app. EG, am I on the right track?

So I tried this and found that wifi network changing will not affect a non-pwa appstudio program from continuing to run on the new wifi network.

However, i did find that it is not easy to create an https web server on these MCUs. Http is the most that is supported as a web server.

The brings us to CORS errors. A https origin can not call an http endpoint even with what appears to be a valud csp and cors headers. I will create an additional topic just for details about http cors and what works.

Final observation: even if a request returns with a cors error, the mcu did get the message. Do we care if we don’t get a response or a cors error response? Aren’t we going to check communications with the device back on the original wifi network?