Mercurial Hosting > luan
diff src/luan/modules/http/Server.luan @ 1265:3f4644246e39
LuanHandler cleanup and add Server.serve_for_proxy
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 25 Sep 2018 19:51:34 -0600 |
parents | c147e2e877e3 |
children | 7fc83fd2a39a |
line wrap: on
line diff
--- a/src/luan/modules/http/Server.luan Tue Sep 25 17:03:57 2018 -0600 +++ b/src/luan/modules/http/Server.luan Tue Sep 25 19:51:34 2018 -0600 @@ -79,4 +79,15 @@ Server.start_rpc() end +function Server.serve_for_proxy(dir,port) + port = port or 8080 + Server.init_dir(dir) + local handler = LuanHandler.new() + handler = IndexHandler.new(handler) + handler = ContentTypeHandler.new(handler) + handler = SafeHandler.new(handler) + Server.server = JavaServer.new(port,handler) + Server.start() +end + return Server