comparison mod_admin_web/admin_web/mod_admin_web.lua @ 4180:a8aacfbdaea9

mod_admin_web: Serve resources from resource path in trunk/0.11 See trunk/be73df6765b9
author Kim Alvefur <zash@zash.se>
date Thu, 08 Oct 2020 12:26:56 +0200
parents 179424d557f2
children fcc6b92869d4
comparison
equal deleted inserted replaced
4179:bcff0e8b7b4d 4180:a8aacfbdaea9
128 local http_files = require "net.http.files"; 128 local http_files = require "net.http.files";
129 serve = http_files.serve; 129 serve = http_files.serve;
130 end) then 130 end) then
131 serve = module:depends"http_files".serve; 131 serve = module:depends"http_files".serve;
132 end 132 end
133 local path = module:get_directory() .. "/www_files";
134 if module.resource_path then
135 -- Available from trunk be73df6765b9 if installed via luarocks
136 path = module.resource_path .. "/admin_web/www_files";
137 end
133 local serve_file = serve { 138 local serve_file = serve {
134 path = module:get_directory() .. "/www_files"; 139 path = path;
135 }; 140 };
136 141
137 -- Setup HTTP server 142 -- Setup HTTP server
138 module:provides("http", { 143 module:provides("http", {
139 name = "admin"; 144 name = "admin";