diff options
author | Kim Alvefur <zash@zash.se> | 2012-12-21 20:40:29 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-12-21 20:40:29 +0100 |
commit | 4130b38a58a4065d7157be93b47fce98fce6ab0e (patch) | |
tree | 6593a177aee8edc7178e3c3da98b2ad8c7b860eb /plugins | |
parent | 87cf947c6c9255777c55fd07450ea74fbb97bfc7 (diff) | |
download | prosody-4130b38a58a4065d7157be93b47fce98fce6ab0e.tar.gz prosody-4130b38a58a4065d7157be93b47fce98fce6ab0e.zip |
mod_http_files: Expose function other modules can use to combine their routes with file paths to serve
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_http_files.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/mod_http_files.lua b/plugins/mod_http_files.lua index 311b3a4b..a96db7b6 100644 --- a/plugins/mod_http_files.lua +++ b/plugins/mod_http_files.lua @@ -126,6 +126,14 @@ function serve(opts) return serve_file; end +function wrap_route(routes) + for route,handler in pairs(routes) do + if type(handler) == "table" and handler.path then + routes[route] = serve(handler); + end + end + return routes; +end if base_path then module:provides("http", { |