I’ve been looking at lots of online examples using ESP8266WebServer. Even got a simple server running very quickly. Now I want to do something a little more advanced.
I want to serve the html from a file in the SPIFFS (I believe using the streamFile() method) rather than building it up in a large String object like a lot of the simpler examples do. I’ve studied an example of this technique already. But, in my case, one of the text elements in the web page needs to be computed dynamically before being sent (say a Temperature or a Voltage reading).
So, I’m looking for ideas of how to supply this dynamic value while still pulling the bulk of the page from SPIFFS. I imagine one way might be to send the SPIFFS file line-by-line. I’d break to insert the dynamic value at the proper point and the continue reading and sending the file (or a different file). Maybe there’s an html solution, like a tag that causes the browser to issue another request - this time just for the dynamic value to be inserted at the proper point?
Sorry for the long-winded question as well as my obvious ignorance of both ESP8266 and html coding. But, any help would be appreciated.
Thanks.
Greg