mod_http: Log a debug message when adding new http apps and warn if no http ports...
authorKim Alvefur <zash@zash.se>
Mon, 23 Mar 2015 17:44:12 +0000 (18:44 +0100)
committerKim Alvefur <zash@zash.se>
Mon, 23 Mar 2015 17:44:12 +0000 (18:44 +0100)
plugins/mod_http.lua

index 86689affdd12729cf036b0749928b95bbbdeadf8..9ff3af748e7490627245b1578ef8ca7260ce7859 100644 (file)
@@ -110,6 +110,12 @@ function module.add_host(module)
                                module:log("error", "Invalid route in %s, %q. See http://prosody.im/doc/developers/http#routes", app_name, key);
                        end
                end
+               local services = portmanager.get_active_services();
+               if services:get("https") or services:get("http") then
+                       module:log("debug", "Serving '%s' at %s", app_name, module:http_url(app_name, app_path));
+               else
+                       module:log("warn", "Not listening on any ports, '%s' will be unreachable", app_name);
+               end
        end
        
        local function http_app_removed(event)