Looking for a simple HTML-template feature for ESP8266WebServer #8842
Unanswered
chess-levin
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi folks,
I'm using ESP8266WebServer for my ESP8266-12 project. I don't need async communication or several open connections. ESP826WebServer is small, is compatible with other lib and does nearly all I require from a web-server ;-). But I miss a way to realise a small HTML-template prozessor. Just to replace some place-holders in a HTML-template by some values or strings. I store my html files with Littlefs and serve them with
serveStatic()
.I don't want to implement a REST-API and use Ajax-Calls from the browser.
Now I need some hints how to implement this feature (I've only a small C++ knowledge).
The ESP8266WebServer.h shows, that there is no way of extending
serveStatic()
, but theon()
method has twoTHandlerFunction
sUntil now I'm using just one of these to define my request-handler to build my response to a certain request. My idea was may I could use the 2nd handler for implementing template processing. But I got stuck here...
Any help appreciated
Beta Was this translation helpful? Give feedback.
All reactions