comparison mod_http_index/mod_http_index.lua @ 3336:4af114684e0a

mod_http_index: Allow listed modules to include a friendlier name Example: ``` module:provides("http", { name = "demo"; title = "Demo HTTP Module"; route = { GET = function() return "Hello"; end; }; }); ```
author Kim Alvefur <zash@zash.se>
date Thu, 27 Sep 2018 17:13:10 +0200
parents 7953b7dde6e7
children f169d9a513c6
comparison
equal deleted inserted replaced
3335:04fe2b41da91 3336:4af114684e0a
28 local host_items = module:get_host_items("http-provider"); 28 local host_items = module:get_host_items("http-provider");
29 local http_apps = {} 29 local http_apps = {}
30 for _, item in ipairs(host_items) do 30 for _, item in ipairs(host_items) do
31 if module.name ~= item._provided_by then 31 if module.name ~= item._provided_by then
32 table.insert(http_apps, { 32 table.insert(http_apps, {
33 title = item.title or item.name;
33 name = item.name; 34 name = item.name;
34 module = "mod_" .. item._provided_by; 35 module = "mod_" .. item._provided_by;
35 url = relative(canonical, module:http_url(item.name, item.default_path)); 36 url = relative(canonical, module:http_url(item.name, item.default_path));
36 }); 37 });
37 end 38 end