diff src/luan/modules/http/Server.luan @ 1605:ef9d96aeb541

use FileHandler in WebHandler
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 17 Apr 2021 18:11:37 -0600
parents d9a5405a3102
children fa066aaa068c
line wrap: on
line diff
--- a/src/luan/modules/http/Server.luan	Fri Apr 16 19:19:39 2021 -0600
+++ b/src/luan/modules/http/Server.luan	Sat Apr 17 18:11:37 2021 -0600
@@ -65,11 +65,11 @@
 	Server.init_dir(dir)
 	local dir_path = match(Http.dir,"^file:(.*)$") or error "server dir must be scheme 'file:'"
 	local file_handler = FileHandler.new(dir_path)
+	local luan_handler = LuanHandler.new()
+	local handler = ListHandler.new( luan_handler, file_handler )
+	handler = IndexHandler.new(handler)
 	local dir_handler = DirHandler.new(file_handler)
-	local luan_handler = LuanHandler.new()
 	local not_found_hander = NotFound.new(luan_handler)
-	local handler = ListHandler.new( file_handler, luan_handler )
-	handler = IndexHandler.new(handler)
 	handler = ListHandler.new( handler, dir_handler, not_found_hander )
 	handler = ContentTypeHandler.new(handler)
 	handler = SafeHandler.new(handler)