A (very) simple web server written in Lua for the ESP8266 firmware NodeMCU.
Upload httpserver.lua using luatool.py or equivalent. Add the following to your init.lua in order to start the server:
require("httpserver")
server = httpserver.start(80, 10)
80 is the port your server is listening to, and 10 is the timeout (in seconds) for clients.
All the files you upload must be prefixed with «http/». Wait, what?
Yes: NodeMCU’s filesystem does not support folders, but filenames can contain slashes.
Example: Say the IP for your ESP8266 is 2.2.2.2 and the server is running in the default port 80. Go to http://2.2.2.2/index.html using your web browser. The ESP8266 will serve you with the contents of the file «http/myPage.html» (if it exists). If you visit the root (/) then index.html is server. By the way, the URLs are case-sensitive.