From: Alexandre Terrasa Date: Mon, 23 May 2016 20:10:15 +0000 (-0400) Subject: lib/popcorn: StaticHandler use `default_file` X-Git-Url: http://nitlanguage.org lib/popcorn: StaticHandler use `default_file` Signed-off-by: Alexandre Terrasa --- 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