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-04 years ago655 downloads
1.1-04 years ago506 downloads
1.0-04 years ago600 downloads
0.9-04 years ago96 downloads
0.8-04 years ago(revision: 2)131 downloads
0.7-04 years ago172 downloads
0.6-04 years ago(revision: 2)755 downloads
0.5-04 years ago57 downloads
0.4-04 years ago53 downloads
0.3-04 years ago381 downloads
0.2-04 years ago113 downloads
0.1-04 years ago9 downloads

Dependency for

APIOAK, Apache APISIX, mygateway

Manifests