Skip to content

Can I add a path parameter from plugin_api? #12486

Closed Answered by elvus
elvus asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks @SkyeYoung I solved it:

{
    methods = {"GET"},
    uri = string.format("%s/example/*", prefix),
    handler = function(ctx)
        local path = ctx.var.uri:match("/example/(.*)$") -- extract the path parameter
        return 200, {message = "OK", path = path}
    end,
}

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@SkyeYoung
Comment options

@SkyeYoung
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by SkyeYoung
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
wait for update wait for the author's response in this issue/PR
2 participants