# HG changeset patch # User Kim Alvefur # Date 1356118829 -3600 # Node ID cc2aed452a629c10b2550af8d764ab14bea4b461 # Parent 700ff21a0451a4542a145da770753b903fd5fd21 mod_http_files: Expose function other modules can use to combine their routes with file paths to serve diff -r 700ff21a0451 -r cc2aed452a62 plugins/mod_http_files.lua --- 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", {