The solution is easy.
The webserver software can be used as a framework to control led's, relays, motors etc.
Mostly the webpage is hosted on the ESP8266 or ESP32 itself.
But that does not need to be.
My example has two ESP8266's wit each a led running both a webserver that serves no webpage.
The webpage is at my PC and that sends info to the ESP's.
http://lucstechblog.blogspot.com/2022/0 ... rvers.html