Skip to content

Instantly share code, notes, and snippets.

@cablehead
Created July 14, 2016 18:50
Show Gist options
  • Save cablehead/45cd8914ddab85cd4382f9833600302e to your computer and use it in GitHub Desktop.
Save cablehead/45cd8914ddab85cd4382f9833600302e to your computer and use it in GitHub Desktop.
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