Skip to content

Instantly share code, notes, and snippets.

@thibaultcha
Last active June 28, 2018 01:17
Show Gist options
  • Save thibaultcha/188d5e602298f21b38051d5ab3b4571a to your computer and use it in GitHub Desktop.
Save thibaultcha/188d5e602298f21b38051d5ab3b4571a to your computer and use it in GitHub Desktop.
Kong 0.14.0 PDK example
-- fictional example of a plugin's handler.lua using the PDK
function Handler:access(conf)
if kong.request.get_method() == "GET" then
-- retrieve the client request's path
local path = kong.request.get_path()
-- make the request to the service with the updated path
kong.service.request.set_path(path .. "/hello/world")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment