Mercurial > prosody-modules
comparison mod_http_libjs/mod_http_libjs.lua @ 4087:88a469b285f5
mod_http_libjs: New module to serve common CSS/Javascript libraries
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 07 Sep 2020 13:33:42 +0100 |
parents | |
children | de2390d6bbe4 |
comparison
equal
deleted
inserted
replaced
4086:50644402c6f5 | 4087:88a469b285f5 |
---|---|
1 local mime_map = module:shared("/*/http_files/mime").types or { | |
2 css = "text/css", | |
3 js = "application/javascript", | |
4 }; | |
5 | |
6 local libjs_path = module:get_option_string("libjs_path", "/usr/share/javascript"); | |
7 | |
8 module:provides("http", { | |
9 default_path = "/share"; | |
10 route = { | |
11 ["GET /*"] = require "net.http.files".serve({ path = libjs_path, mime_map = mime_map }); | |
12 } | |
13 }); |