Mercurial Hosting > luan
diff src/luan/modules/http/Server.luan @ 1685:46cf5137cb6b
misc fixes
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 08 Jun 2022 20:13:54 -0600 |
parents | fa066aaa068c |
children | b82767112d8e |
line wrap: on
line diff
--- a/src/luan/modules/http/Server.luan Sun Jun 05 18:03:32 2022 -0600 +++ b/src/luan/modules/http/Server.luan Wed Jun 08 20:13:54 2022 -0600 @@ -39,7 +39,9 @@ Http.is_serving = true function Io.schemes.site(path) local u = uri( dir..path ) - u.uri_string = "site:"..path + if u ~= nil then + u.uri_string = "site:"..path + end return u end end @@ -82,17 +84,4 @@ return server, luan_handler end -function Server.serve_for_proxy(dir,port,LuanHandlerClass) - port = port or 8080 - LuanHandlerClass = LuanHandlerClass or LuanHandler - Server.init_dir(dir) - local luan_handler = LuanHandlerClass.new() - local handler = IndexHandler.new(luan_handler) - handler = ContentTypeHandler.new(handler) - handler = SafeHandler.new(handler) - local server = JavaServer.new(port,handler) - Server.start(server) - return server, luan_handler -end - return Server