Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
5d62624e
Commit
5d62624e
authored
Jan 19, 2015
by
Vladimir Dronnikov
Browse files
cleanup http module
parent
4fbff3f3
Changes
2
Show whitespace changes
Inline
Side-by-side
lua_modules/http/http-example.lua
View file @
5d62624e
...
...
@@ -6,9 +6,8 @@
------------------------------------------------------------------------------
require
(
"http"
).
createServer
(
80
,
function
(
req
,
res
)
-- analyse method and url
print
(
"+R"
,
req
.
method
,
req
.
url
)
print
(
"+R"
,
req
.
method
,
req
.
url
,
node
.
heap
()
)
-- setup handler of headers, if any
--[[
req
.
onheader
=
function
(
self
,
name
,
value
)
-- print("+H", name, value)
-- E.g. look for "content-type" header,
...
...
@@ -34,8 +33,7 @@ require("http").createServer(80, function(req, res)
res
:
finish
()
end
end
]]
-- or just do something not waiting till body (if any) comes
--res:finish("Hello, world!")
res
:
finish
(
"Salut, monde!"
)
--
res:finish("Salut, monde!")
end
)
lua_modules/http/http.lua
View file @
5d62624e
...
...
@@ -87,8 +87,6 @@ do
return
res
end
tmr
.
wdclr
()
------------------------------------------------------------------------------
-- HTTP parser
------------------------------------------------------------------------------
...
...
@@ -190,8 +188,6 @@ do
end
end
tmr
.
wdclr
()
------------------------------------------------------------------------------
-- HTTP server
------------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment