Changeset

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 4179:bcff0e8b7b4d
children 4181:fcc6b92869d4
files mod_admin_web/admin_web/mod_admin_web.lua
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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