X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_httpserver.lua;h=a863928148bf33407b80c0c7cd8f31638813a84e;hb=58bf4369711eed604ab2a485f7f957e522a05796;hp=98a3a36ea19929b3eed6a92300493e20821e8dd7;hpb=82aa9c749335a601ec308148ce95e3c680ad7705;p=prosody.git diff --git a/plugins/mod_httpserver.lua b/plugins/mod_httpserver.lua index 98a3a36e..a8639281 100644 --- a/plugins/mod_httpserver.lua +++ b/plugins/mod_httpserver.lua @@ -28,14 +28,4 @@ local function handle_request(method, body, request) end local ports = config.get(module.host, "core", "http_ports") or { 5280 }; -for _, options in ipairs(ports) do - local port, base, ssl, interface = 5280, "files", false, nil; - if type(options) == "number" then - port = options; - elseif type(options) == "table" then - port, base, ssl, interface = options.port or 5280, options.path or "files", options.ssl or false, options.interface; - elseif type(options) == "string" then - base = options; - end - httpserver.new{ port = port, base = base, handler = handle_request, ssl = ssl } -end +httpserver.new_from_config(ports, "files", handle_request);