mod_http_libjs: Allow configurable path

This commit is contained in:
Matthew Wild 2020-11-11 16:42:08 +00:00
parent 13bddf20d4
commit 668592c87a
1 changed files with 3 additions and 1 deletions

View File

@ -3,9 +3,11 @@ local mime_map = module:shared("/*/http_files/mime").types or {
js = "application/javascript",
};
local libjs_path = module:get_option_string("libjs_path", "/usr/share/javascript");
module:provides("http", {
default_path = "/share";
route = {
["GET /*"] = require "net.http.files".serve({ path = "/usr/share/javascript", mime_map = mime_map });
["GET /*"] = require "net.http.files".serve({ path = libjs_path, mime_map = mime_map });
}
});