Comparison

plugins/mod_http.lua @ 6530:35ebcb733c4c

mod_http: Log name and base URL of HTTP apps
author Kim Alvefur <zash@zash.se>
date Mon, 08 Dec 2014 15:49:11 +0100
parent 6504:e1659f32852e
child 6583:93bab6958683
comparison
equal deleted inserted replaced
6529:a2dadaa9137f 6530:35ebcb733c4c
82 module.environment.apps = apps; 82 module.environment.apps = apps;
83 local function http_app_added(event) 83 local function http_app_added(event)
84 local app_name = event.item.name; 84 local app_name = event.item.name;
85 local default_app_path = event.item.default_path or "/"..app_name; 85 local default_app_path = event.item.default_path or "/"..app_name;
86 local app_path = get_base_path(module, app_name, default_app_path); 86 local app_path = get_base_path(module, app_name, default_app_path);
87 module:log("debug", "Serving '%s' at %s", app_name, module:http_url(app_name, app_path));
87 if not app_name then 88 if not app_name then
88 -- TODO: Link to docs 89 -- TODO: Link to docs
89 module:log("error", "HTTP app has no 'name', add one or use module:provides('http', app)"); 90 module:log("error", "HTTP app has no 'name', add one or use module:provides('http', app)");
90 return; 91 return;
91 end 92 end