lua-resty-libr3

This is a libr3 implementation library base on FFI for Lua-Openresty

$ luarocks install lua-resty-libr3

-- r3 router
local r3 = require("resty.r3").new();
local encode_json = require("cjson.safe").encode

function foo(params) -- foo handler
ngx.say("foo: ", encode_json(params))
end

-- routing
r3:get("/foo/{id}/{name}", foo)

-- don't forget!!!
r3:compile()

-- dispatch
local ok = r3:dispatch("/foo/a/b", ngx.req.get_method())
if not ok then
ngx.exit(404)
end

Versions

1.2-03 years ago643 downloads
1.1-03 years ago503 downloads
1.0-03 years ago597 downloads
0.9-03 years ago93 downloads
0.8-03 years ago(revision: 2)128 downloads
0.7-03 years ago169 downloads
0.6-03 years ago(revision: 2)751 downloads
0.5-03 years ago54 downloads
0.4-03 years ago50 downloads
0.3-03 years ago378 downloads
0.2-03 years ago109 downloads
0.1-03 years ago6 downloads

Dependency for

APIOAK, Apache APISIX, mygateway

Manifests