Comparison

plugins/mod_http.lua @ 6597:321321f566fb

mod_http: Log a debug message when adding new http apps and warn if no http ports are enabled
author Kim Alvefur <zash@zash.se>
date Mon, 23 Mar 2015 18:44:12 +0100
parent 6596:27c10ee82d60
child 6598:4b4852c4f96a
comparison
equal deleted inserted replaced
6596:27c10ee82d60 6597:321321f566fb
108 end 108 end
109 else 109 else
110 module:log("error", "Invalid route in %s, %q. See http://prosody.im/doc/developers/http#routes", app_name, key); 110 module:log("error", "Invalid route in %s, %q. See http://prosody.im/doc/developers/http#routes", app_name, key);
111 end 111 end
112 end 112 end
113 local services = portmanager.get_active_services();
114 if services:get("https") or services:get("http") then
115 module:log("debug", "Serving '%s' at %s", app_name, module:http_url(app_name, app_path));
116 else
117 module:log("warn", "Not listening on any ports, '%s' will be unreachable", app_name);
118 end
113 end 119 end
114 120
115 local function http_app_removed(event) 121 local function http_app_removed(event)
116 local app_handlers = apps[event.item.name]; 122 local app_handlers = apps[event.item.name];
117 apps[event.item.name] = nil; 123 apps[event.item.name] = nil;