Updated examples to remove yields, pass req param. Integration woes.

This commit is contained in:
Marcos Kirsch
2016-02-15 22:33:30 -06:00
parent d31b2d2c89
commit 5ccc69dc73
3 changed files with 2 additions and 9 deletions

View File

@@ -17,7 +17,6 @@ local function pushTheButton(connection, pin)
-- Send back JSON response.
connection:send("HTTP/1.0 200 OK\r\nContent-Type: application/json\r\nCache-Control: private, no-store\r\n\r\n")
coroutine.yield()
connection:send('{"error":0, "message":"OK"}')
end
@@ -28,7 +27,6 @@ return function (connection, req, args)
elseif args.door == "2" then pushTheButton(connection, 2) -- GPIO2
else
connection:send("HTTP/1.0 400 OK\r\nContent-Type: application/json\r\nCache-Control: private, no-store\r\n\r\n")
coroutine.yield()
connection:send('{"error":-1, "message":"Bad door"}')
end
end