NodeMcu as both server and client. Is it possible?

About a year ago I used a sketch from the net to use a NodeMcu as a server for Alexa sevice to switch lights etc by emulating Wemos devices using UDP.

It has worked very successfully.

Now I would like to use it as a bolier thermostat just switching the boiler on/off as necessary. I have the code working as a single on off switch and the temperature setting is via two buttons up/down.

I have seen code somewhere that serves up a webpage to see the current temperature and also the setpoint but I believe it uses the client mode.

I'm not entirely versed in the operation of server client etc.

My question is, is this doable and how? An answer in outline form or any example that you may know of would be fine. I just don't want to chase my tail if it's a non starter.