Software /
code /
prosody-modules
Comparison
mod_admin_web/admin_web/mod_admin_web.lua @ 3549:b059a3fb2a58
Update modules using mod_http_files to serve files for change in Prosody trunk
See commits in Prosody: f1594893998f afc48785f738 a39f3681d685 c93fdec624c7
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 05 Apr 2019 18:57:51 +0200 |
parent | 2871:c3317f61f3f9 |
child | 3550:8079e9c6d419 |
comparison
equal
deleted
inserted
replaced
3548:8a15a9b13881 | 3549:b059a3fb2a58 |
---|---|
120 function module.add_host(module) | 120 function module.add_host(module) |
121 -- Dependencies | 121 -- Dependencies |
122 module:depends("bosh"); | 122 module:depends("bosh"); |
123 module:depends("admin_adhoc"); | 123 module:depends("admin_adhoc"); |
124 module:depends("http"); | 124 module:depends("http"); |
125 local serve_file = module:depends("http_files").serve { | 125 |
126 local serve; | |
127 if not pcall(function () | |
128 local http_files = require "net.http.files"; | |
129 serve = http_files.serve; | |
130 end) then | |
131 serve = module:depends"http_files".serve; | |
132 end | |
133 local serve_file = serve { | |
126 path = module:get_directory() .. "/www_files"; | 134 path = module:get_directory() .. "/www_files"; |
127 }; | 135 }; |
128 | 136 |
129 -- Setup HTTP server | 137 -- Setup HTTP server |
130 module:provides("http", { | 138 module:provides("http", { |