[SOLVED] ESP8266 local server issue

Firstly, I had to edit your post to correct the posted code for proper viewing, as shown in the Forum’s Welcome Topic…

Next, hopefully you are aware that the Cloud Server and your Local Server are completely separate Servers…

So in order to switch between them, you need to log into the respective server, with it’s respective project (that you created while logged into said server) and dedicated Auth code (that is generated by the respective server) for use in the paired App/Sketch.