plugins/mod_http.lua
changeset 6605 61b6a4fc65f1
parent 6586 93bab6958683
parent 6601 4b4852c4f96a
child 6967 ed5440a6ef7f
child 7584 01d0d466d7be
--- a/plugins/mod_http.lua	Wed Jan 21 02:55:27 2015 +0100
+++ b/plugins/mod_http.lua	Thu Mar 26 16:48:39 2015 +0000
@@ -74,6 +74,8 @@
 			return url_build(url);
 		end
 	end
+	module:log("warn", "No http ports enabled, can't generate an external URL");
+	return "http://disabled.invalid/";
 end
 
 function module.add_host(module)
@@ -118,6 +120,12 @@
 				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)