We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd144e0 commit cce41abCopy full SHA for cce41ab
doc/code_snippets/snippets/config/instances.enabled/application_role_http_api/http-api.lua
@@ -37,7 +37,10 @@ local function apply(cfg)
37
if httpd then
38
httpd:stop()
39
end
40
- httpd = require('http.server').new(cfg.host, cfg.port)
+ local cfg_with_defaults = listen_address_schema:apply_default(cfg)
41
+ local host = listen_address_schema:get(cfg_with_defaults, 'host')
42
+ local port = listen_address_schema:get(cfg_with_defaults, 'port')
43
+ httpd = require('http.server').new(host, port)
44
local response_headers = { ['content-type'] = 'application/json' }
45
httpd:route({ path = '/band/:id', method = 'GET' }, function(req)
46
local id = req:stash('id')
0 commit comments