Source

luaeio / demo.lua

local eio = require("eio")

function http_handler(r)
	print(r.uri)
	r:write("hello, root")
end

function http_handler_index(r)
	print(r.uri)
	r:write("hello, index")
end

local http = eio.http_server(8080, {["/"] = http_handler, ["/index"] = http_handler_index})
http:serve()