comparison mod_admin_web/admin_web/mod_admin_web_timber.lua @ 637:210f4ce2697c

mod_admin_web: HTTP methods are now required
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 27 Apr 2012 19:59:21 +0200
parents b3a3199255d7
children a826b61c8f3a
comparison
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 ()