Mercurial > prosody-modules
view mod_http_libjs/mod_http_libjs.lua @ 4547:a9e997d5eb94
mod_rest: Replace 'oob_url' with datamapper-native 'oob'
While 'oob_url' is simpler and covers all current use, it's harder to
describe the XML mapping.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 25 Apr 2021 16:38:20 +0200 |
parents | de2390d6bbe4 |
children | f0efbb0b0b5b |
line wrap: on
line source
local mime_map = module:shared("/*/http_files/mime").types or { css = "text/css", js = "application/javascript", }; local serve; if not pcall(function () local http_files = require "net.http.files"; serve = http_files.serve; end) then serve = module:depends"http_files".serve; end local libjs_path = module:get_option_string("libjs_path", "/usr/share/javascript"); module:provides("http", { default_path = "/share"; route = { ["GET /*"] = serve({ path = libjs_path, mime_map = mime_map }); } });