From 50e61f5bad9442d70f67657cf5af6941467bab7c Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Mon, 23 May 2016 16:10:15 -0400 Subject: [PATCH] lib/popcorn: StaticHandler use `default_file` Signed-off-by: Alexandre Terrasa --- lib/popcorn/pop_handlers.nit | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/popcorn/pop_handlers.nit b/lib/popcorn/pop_handlers.nit index 1c20b67..5d84961 100644 --- a/lib/popcorn/pop_handlers.nit +++ b/lib/popcorn/pop_handlers.nit @@ -235,10 +235,16 @@ class StaticHandler # Static files directory to serve. var static_dir: String + # Default file to serve if nothing matches the request. + # + # `null` for no default file. + var default_file: nullable String + # Internal file server used to lookup and render files. var file_server: FileServer is lazy do var srv = new FileServer(static_dir) srv.show_directory_listing = false + srv.default_file = default_file return srv end -- 1.7.9.5