mod_admin_web/admin_web/mod_admin_web_timber.lua
changeset 637 210f4ce2697c
parent 636 b3a3199255d7
child 663 a826b61c8f3a
equal deleted inserted replaced
636:b3a3199255d7 637:210f4ce2697c
   133 function module.add_host(module)
   133 function module.add_host(module)
   134 	module:depends("http");
   134 	module:depends("http");
   135 	module:provides("http", {
   135 	module:provides("http", {
   136 		name = "admin";
   136 		name = "admin";
   137 		route = {
   137 		route = {
   138 			["/"] = function(event)
   138 			["GET"] = function(event)
   139 				event.response.headers.location = event.request.path .. "/";
   139 				event.response.headers.location = event.request.path .. "/";
   140 				return 301;
   140 				return 301;
   141 			end;
   141 			end;
   142 			["/*"] = serve_file;
   142 			["GET /*"] = serve_file;
   143 		}
   143 		}
   144 	});
   144 	});
   145 end
   145 end
   146 
   146 
   147 prosody.events.add_handler("server-started", function ()
   147 prosody.events.add_handler("server-started", function ()