Skip to content

Instantly share code, notes, and snippets.

@mehuled
Last active April 14, 2024 14:03
Show Gist options
  • Save mehuled/0f17e43df5b4b1c46961a5244791aed2 to your computer and use it in GitHub Desktop.
Save mehuled/0f17e43df5b4b1c46961a5244791aed2 to your computer and use it in GitHub Desktop.
function plugin:access(plugin_conf)
_G.emmy = {}
_G.emmy.fixPath = function(path)
return string.gsub(path, '/usr/local/kong/plugins/', '/{path_to_working_directory}/')
end
package.cpath = package.cpath .. ';/usr/local/emmy/?.so'
local dbg = require('emmy_core')
dbg.tcpListen('localhost', 9966)
-- Wait for IDE connection
dbg.waitIDE()
-- your custom code here
kong.log.inspect(plugin_conf) -- check the logs for a pretty-printed config!
kong.service.request.set_header(plugin_conf.request_header, "this is on a request")
end --]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment