Created
July 14, 2016 18:50
-
-
Save cablehead/45cd8914ddab85cd4382f9833600302e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local levee = require("levee") | |
local _ = levee._ | |
local h = levee.Hub() | |
local err, serve = h.http:listen(8099) | |
for conn in serve do | |
h:spawn(function() | |
for req in conn do | |
print(req.method, req.path, _.repr(req.headers)) | |
req.response:send({levee.HTTPStatus(200), {}, "Hello world\n"}) | |
end | |
end) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment