Comparison

mod_invites_page/mod_invites_page.lua @ 4975:733e5513f691

various: Use 0.12+ API for serving files from the file system over HTTP Using mod_http_files this way is deprecated. Having the base behavior in a separate module makes it easier to have a specialized module with coherent behavior that does not do things when not explicitly enabled.
author Kim Alvefur <zash@zash.se>
date Mon, 18 Jul 2022 13:58:27 +0200
parent 4408:2c47b8110c48
child 4976:75b6e5df65f9
comparison
equal deleted inserted replaced
4974:807007913f67 4975:733e5513f691
31 31
32 if not external_only then 32 if not external_only then
33 -- Load HTTP-serving dependencies 33 -- Load HTTP-serving dependencies
34 if prosody.shutdown then -- not if running under prosodyctl 34 if prosody.shutdown then -- not if running under prosodyctl
35 module:depends("http"); 35 module:depends("http");
36 http_files = module:depends("http_files"); 36 if not pcall(function ()
37 http_files = require "net.http.files";
38 end) then
39 http_files = module:depends"http_files";
40 end
37 end 41 end
38 -- Calculate automatic base_url default 42 -- Calculate automatic base_url default
39 base_url = module.http_url and module:http_url(); 43 base_url = module.http_url and module:http_url();
40 44
41 -- Load site apps info 45 -- Load site apps info