mod_admin_web: Serve resources from resource path in trunk/0.11
authorKim Alvefur <zash@zash.se>
Thu, 08 Oct 2020 12:26:56 +0200
changeset 4184 a8aacfbdaea9
parent 4183 bcff0e8b7b4d
child 4185 fcc6b92869d4
mod_admin_web: Serve resources from resource path in trunk/0.11 See trunk/be73df6765b9
mod_admin_web/admin_web/mod_admin_web.lua
--- a/mod_admin_web/admin_web/mod_admin_web.lua	Thu Oct 08 12:20:48 2020 +0200
+++ b/mod_admin_web/admin_web/mod_admin_web.lua	Thu Oct 08 12:26:56 2020 +0200
@@ -130,8 +130,13 @@
 	end) then
 		serve = module:depends"http_files".serve;
 	end
+	local path = module:get_directory() .. "/www_files";
+	if module.resource_path then
+		-- Available from trunk be73df6765b9 if installed via luarocks
+		path = module.resource_path .. "/admin_web/www_files";
+	end
 	local serve_file = serve {
-		path = module:get_directory() .. "/www_files";
+		path = path;
 	};
 
 	-- Setup HTTP server