Updated examples to remove yields, pass req param. Integration woes.
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
local function sendAttr(connection, attr, val)
|
||||
connection:send("<li><b>".. attr .. ":</b> " .. val .. "<br></li>\n")
|
||||
coroutine.yield()
|
||||
end
|
||||
|
||||
return function (connection, args)
|
||||
return function (connection, req, args)
|
||||
dofile("httpserver-header.lc")(connection, 200, 'html')
|
||||
connection:send('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>A Lua script sample</title></head><body><h1>Node info</h1><ul>')
|
||||
coroutine.yield()
|
||||
majorVer, minorVer, devVer, chipid, flashid, flashsize, flashmode, flashspeed = node.info();
|
||||
sendAttr(connection, "NodeMCU version" , majorVer.."."..minorVer.."."..devVer)
|
||||
sendAttr(connection, "chipid" , chipid)
|
||||
|
||||
Reference in New Issue
Block a user