httpserver-error.lua 470 B

12345678
  1. -- httpserver-error.lua
  2. -- Part of nodemcu-httpserver, handles sending error pages to client.
  3. -- Author: Marcos Kirsch, Gregor Hartmann
  4. return function (connection, req, args)
  5. local statusString = dofile("httpserver-header.lc")(connection, req.code, "html", false, req.headers)
  6. connection:send("<html><head><title>" .. req.code .. " - " .. statusString .. "</title></head><body><h1>" .. req.code .. " - " .. statusString .. "</h1></body></html>\r\n")
  7. end