Running node js server
It will read the state before loading the page
I also have this code setup to read and set each pin individually if anyone is interested
https://youtu.be/DLAhsHjg1RY
Github: https://github.com/arun2118/ESP-WEBserver
I'm going to add a arduino, ds18s20, and a display(16x2 or 20x4) maybe a PIR and make a standalone thermostat