Software /
code /
prosody
Changeset
5265:cc2aed452a62
mod_http_files: Expose function other modules can use to combine their routes with file paths to serve
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 21 Dec 2012 20:40:29 +0100 |
parents | 5264:700ff21a0451 |
children | 5266:5c3a3ef6b769 |
files | plugins/mod_http_files.lua |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_http_files.lua Fri Dec 21 20:34:40 2012 +0100 +++ b/plugins/mod_http_files.lua Fri Dec 21 20:40:29 2012 +0100 @@ -126,6 +126,14 @@ 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", {