nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0f9cd9
)
lib/popcorn: StaticHandler use `default_file`
author
Alexandre Terrasa
<alexandre@moz-code.org>
Mon, 23 May 2016 20:10:15 +0000
(16:10 -0400)
committer
Alexandre Terrasa
<alexandre@moz-code.org>
Thu, 26 May 2016 21:47:36 +0000
(17:47 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
lib/popcorn/pop_handlers.nit
patch
|
blob
|
history
diff --git
a/lib/popcorn/pop_handlers.nit
b/lib/popcorn/pop_handlers.nit
index
1c20b67
..
5d84961
100644
(file)
--- 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