aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_http_files.lua8
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", {