You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, thanks for this library!
I want to ask a question, I want to routing of the URL is indefinite the length,such as: ip:7500/v1/foo/dir/test/......../test . There may be more levels. So I used regular matching, but.
The POST method can't be used regularly and can't be matched.
If the GET and POST methods are the same as the path, neither method can match.
code:
local r3route = require "resty.r3"
local router_uri =
{
{
path = "/v1/foo/{get_filename}",
method = {"GET"},
handler = main_controllers_get
},
{
path = [[/v1/bar/{bucketname}/{get_filename:([\w-./])}]],
method = {"GET"},
handler = main_controllers_get
},
{
path = "/v1/foo",
method = {"POST"},
handler = main_controllers_post
},
{
path = [[/v1/bar/{bucketname}/{post_filename:([\w-./])}]],
method = {"POST"},
handler = main_controllers_post
}
}
local r3 = r3route.new(router_uri)
r3:compile()
local ok = r3:dispatch(ngx.var.uri , ngx.req.get_method())
if not ok then
ngx.exit(403)
end
How do you solve this problem?
The text was updated successfully, but these errors were encountered:
Hey, thanks for this library!
I want to ask a question, I want to routing of the URL is indefinite the length,such as: ip:7500/v1/foo/dir/test/......../test . There may be more levels. So I used regular matching, but.
code:
How do you solve this problem?
The text was updated successfully, but these errors were encountered: