mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2024-12-22 11:03:48 +01:00
Create base files in rest subdirectory.
This commit is contained in:
parent
ef87b18ed9
commit
c0b06a77fb
21
src/rest/request.lua
Normal file
21
src/rest/request.lua
Normal file
@ -0,0 +1,21 @@
|
||||
local M = {}
|
||||
|
||||
local urlcode = require("util.urlcode")
|
||||
|
||||
function M:new()
|
||||
--parse os.getenv("QUERY_STRING")
|
||||
--parse os.getenv("REPLY")?
|
||||
--parse arg
|
||||
|
||||
local qs = os.getenv("QUERY_STRING")
|
||||
local urlargs = {}
|
||||
urlcode.parsequery(qs, urlargs)
|
||||
|
||||
--supplement urlargs with arguments from the command-line
|
||||
for _, v in ipairs(arg) do
|
||||
local split = v:find("=")
|
||||
if split ~= nil then
|
||||
urlargs[v:sub(1, split - 1)] = v:sub(split + 1)
|
||||
end
|
||||
end
|
||||
end
|
0
src/rest/response.lua
Normal file
0
src/rest/response.lua
Normal file
Loading…
Reference in New Issue
Block a user