Skip to content

Commit

Permalink
Schema validation: update HTTP sample 3
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyaksenov committed Aug 27, 2024
1 parent bd144e0 commit 4c46f3f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ local function apply(cfg)
if httpd then
httpd:stop()
end
httpd = require('http.server').new(cfg.host, cfg.port)
local host = listen_address_schema:get(cfg, 'host')
local port = listen_address_schema:get(cfg, 'port')
httpd = require('http.server').new(host, port)
local response_headers = { ['content-type'] = 'application/json' }
httpd:route({ path = '/band/:id', method = 'GET' }, function(req)
local id = req:stash('id')
Expand Down

0 comments on commit 4c46f3f

Please sign in to comment.