- Luon is a network package for LuaRT.
- Making TCP and HTTP usage easier.
- Adding support for Websocket.
- You can download the files and require it from your main script.
- Check docs to see how to use Luon.
- Usage example for adding and clearing cookies.
require("luon.luon")
local App = Luon.Server("127.0.0.1", 5000)
App:Use(function(req, res, next)
print("[REQ]", req.Method, req.Path)
next()
end)
App:Get("/set", function(req, res)
res:SetCookie("foo", "bar", { path = "/" })
res:send("Cookie set", "text/plain")
end)
App:Get("/clear", function(req, res)
res:ClearCookie("foo")
res:send("Cookie cleared", "text/plain")
end)
App:Listen()- You can ask your questions at LuaRT Discord Server.