Tried your new code, and it works fine, thanks for the update. Hope more will follow!
- the error message in case of an error in a Lua statement is very useful. Had the pleasure of getting some informative error messages while testing
- html and TXT handled nicely
- printing fo GET /filename is nice for debugging (ref. local requestToConsole = true;)
BTW : In your previous version I added "print(payload" in the beginning of the processing function. That's VERY informative for debugging. Would you consider adding a "payloadToConsole" too?
Played with the new code, making a framework for my own, it consists of 4 pages. Below I have added sreendumps of the 4 pages and a ZIP, possibly someone else can benefit from it. I Intend to extend the (now) basic pages further.
- indexgwr.pht to be copied to index.pht, with links to the other pages (inspired by your index,pht)
- files.pht, for file matters
- io.pht, for GPIO/ADC matters
- network.pht, for network matters.
NOTE When the # of files in the files page gets too long (above 7-8 files) the ESP throws the following error:
PANIC: unprotected error in call to Lua API (init.lua:98: need <256 payload)
I imagine this is caused by limitations of the API conn:send command, can't imagine it is in webserver code. Raised a Problem, in the Problem section, but no answer yet.
Sources for the files: