marcoskirsch / nodemcu-httpserver

A (very) simple web server written in Lua for the ESP8266 firmware NodeMCU.
GNU General Public License v2.0
397 stars 166 forks source link

add dynamic errorhandling #83

Closed HHHartmann closed 7 years ago

HHHartmann commented 7 years ago

You can define static files as errorhandlers based on errorcode and file extension.

The last commits add support for six cars (or more) without crash. I serve static files without coroutine now. Very memory effichient!

Tested all sample pages successfully.

Also fix and improve many small details:

ATAMAH commented 7 years ago

For starting: List of MIME types

You can't change "text/html" to just "html" and "application/json" to "json".

HHHartmann commented 7 years ago

Thanks for reviewing the changes. httpserver-header.lc has to be called with the file extension as 3rd parameter and then changes it to the corrosponding MIME type. So "json" becomes "application/json" and "html" becomes "text/html". Calling it with "application/json" would result in the fallback MIME type "text/plain".

HHHartmann commented 7 years ago

So I will close this PR and create separate ones