More typo fixes
This commit is contained in:
parent
0120924403
commit
269b6e35bf
@ -1,5 +1,5 @@
|
|||||||
return function (connection, args)
|
return function (connection, args)
|
||||||
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\Cache-Control: private, no-store\r\n\r\n")
|
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nCache-Control: private, no-store\r\n\r\n")
|
||||||
connection:send('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Arguments</title></head>')
|
connection:send('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Arguments</title></head>')
|
||||||
connection:send('<body>')
|
connection:send('<body>')
|
||||||
connection:send('<h1>Arguments</h1>')
|
connection:send('<h1>Arguments</h1>')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
return function (connection, args)
|
return function (connection, args)
|
||||||
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\Cache-Control: private, no-store\r\n\r\n")
|
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nCache-Control: private, no-store\r\n\r\n")
|
||||||
connection:send('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Server File Listing</title></head>')
|
connection:send('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Server File Listing</title></head>')
|
||||||
connection:send('<body>')
|
connection:send('<body>')
|
||||||
connection:send('<h1>Server File Listing</h1>')
|
connection:send('<h1>Server File Listing</h1>')
|
||||||
|
|||||||
@ -16,7 +16,7 @@ local function pushTheButton(connection, pin)
|
|||||||
gpio.mode(pin, gpio.INPUT)
|
gpio.mode(pin, gpio.INPUT)
|
||||||
|
|
||||||
-- Send back JSON response.
|
-- Send back JSON response.
|
||||||
connection:send("HTTP/1.0 200 OK\r\nContent-Type: application/json\r\Cache-Control: private, no-store\r\n\r\n")
|
connection:send("HTTP/1.0 200 OK\r\nContent-Type: application/json\r\nCache-Control: private, no-store\r\n\r\n")
|
||||||
connection:send('{"error":0, "message":"OK"}')
|
connection:send('{"error":0, "message":"OK"}')
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -26,7 +26,7 @@ return function (connection, args)
|
|||||||
if args.door == "1" then pushTheButton(connection, 3) -- GPIO0
|
if args.door == "1" then pushTheButton(connection, 3) -- GPIO0
|
||||||
elseif args.door == "2" then pushTheButton(connection, 4) -- GPIO2
|
elseif args.door == "2" then pushTheButton(connection, 4) -- GPIO2
|
||||||
else
|
else
|
||||||
connection:send("HTTP/1.0 400 OK\r\nContent-Type: application/json\r\Cache-Control: private, no-store\r\n\r\n")
|
connection:send("HTTP/1.0 400 OK\r\nContent-Type: application/json\r\nCache-Control: private, no-store\r\n\r\n")
|
||||||
connection:send('{"error":-1, "message":"Bad door"}')
|
connection:send('{"error":-1, "message":"Bad door"}')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
local function sendHeader(connection)
|
local function sendHeader(connection)
|
||||||
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\Cache-Control: private, no-store\r\n\r\n")
|
connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nCache-Control: private, no-store\r\n\r\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
local function sendAttr(connection, attr, val)
|
local function sendAttr(connection, attr, val)
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
local function storelist(t)
|
|
||||||
-- connection:send(cjson.encode(t))
|
|
||||||
-- print(cjson.encode(t))
|
|
||||||
file.remove("http/aplist.json")
|
|
||||||
file.open("http/aplist.json","w+")
|
|
||||||
file.writeline(cjson.encode(t))
|
|
||||||
file.close()
|
|
||||||
end
|
|
||||||
|
|
||||||
return function(connection,args)
|
|
||||||
wifi.sta.getap(storelist)
|
|
||||||
connection:send("HTTP/1.0 200 OK\r\nContent-Type: application/json\r\nCache-Control: private, no-store\r\n\r\n")
|
|
||||||
connection:send('{"error":0, "message":"OK"}')
|
|
||||||
end
|
|
||||||
2
init.lua
2
init.lua
@ -25,7 +25,7 @@ local compileAndRemoveIfNeeded = function(f)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local serverFiles = {'httpserver.lua', 'httpserver-request.lua', 'httpserver-static.lua', 'httpserver-error.lua'}
|
local serverFiles = {'httpserver.lua', 'httpserver-request.lua', 'httpserver-static.lua', 'httpserver-error.lua','http/ual.lua'}
|
||||||
for i, f in ipairs(serverFiles) do compileAndRemoveIfNeeded(f) end
|
for i, f in ipairs(serverFiles) do compileAndRemoveIfNeeded(f) end
|
||||||
|
|
||||||
compileAndRemoveIfNeeded = nil
|
compileAndRemoveIfNeeded = nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user