I have a server that can communicate (Python) with its serial port. However, I want that anybody accessing this server from a web socket receives a website based on data from the server's serial port. So a (http?) request from the client should cause the server to get data from the serial port (I know how to communicate in python with the serial port) and then respond to the client based on that data.
I have implemented a basicpython socket
that can get requests by a server and then get the data from its serial port. But how do I send to the Webbrowser client a response (that must be HTML, right?) based on that data? So hardcoding a whole Webserver would be too much, right? What's the best way to to this in python?