'Kong Custom Plugin Admin Interface extension : need access to config of plugin
I'm building a custom plugin and I'm extending the admin interface via api.lua
Functions have the 'self' property where i can get request information but I also need access to the plugin configuration (like handler.lua) .
How can I do that ?
Kong 2.7.0.
return {
["/my-route/:id"] = {
GET = function(self)
-- do some stuff
end
}
}
Thx,
Peter
Update
schema.lua
return {
no_consumer = true, -- this plugin will only be API-wide
fields = {
redis_host = { type = "string" },
redis_port = { type = "number", default = 6379 },
redis_password = { type = "string" },
redis_timeout = { type = "number", default = 2000 },
redis_database = { type = "number", default = 1 }
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
