Changed the return of runJetty so that callers can have the server object.

This commit is contained in:
Jonathan Bernard 2015-12-12 00:44:05 -06:00
parent 81b88344b3
commit 6ebe75402a

View File

@ -34,10 +34,10 @@ public class GroovyDirectoryServer {
rewriteRules: opts.r ?: [],
groovyPatterns: opts.g ?: ["*.groovy"] ]
runJetty(options)
runJetty(options).join()
}
public static void runJetty(options) {
public static Server runJetty(options) {
def server = new Server(options.port)
def handler = new ServletContextHandler(ServletContextHandler.SESSIONS)
@ -73,6 +73,8 @@ public class GroovyDirectoryServer {
server.start()
println "Jetty started on port ${options.port}."
return server
}
public static String getUsage() {