Mercurial Hosting > luan
diff src/luan/modules/http/Server.luan @ 1242:ce3279ef1bd9
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 25 Jun 2018 19:34:52 -0600 |
parents | 7f4a12fb7716 |
children | e55a0c3696fb |
line wrap: on
line diff
--- a/src/luan/modules/http/Server.luan Thu Jun 21 22:30:13 2018 -0600 +++ b/src/luan/modules/http/Server.luan Mon Jun 25 19:34:52 2018 -0600 @@ -29,8 +29,6 @@ local Server = {} -Server.port = 8080 - function Server.init_dir(dir) local dir_uri, dir_path if matches(dir,":") then @@ -68,7 +66,8 @@ Thread.fork(Rpc.serve) end -function Server.serve(dir) +function Server.serve(dir,port) + port = port or 8080 local dir_path = Server.init_dir(dir) local file_handler = FileHandler.new(dir_path) local dir_handler = DirHandler.new(file_handler) @@ -80,7 +79,7 @@ handler = ContentTypeHandler.new(handler) handler = SafeHandler.new(handler) handler = LogHandler.new(handler) - Server.server = JavaServer.new(Server.port,handler) + Server.server = JavaServer.new(port,handler) Server.start() Server.start_rpc() end