diff --git a/src/main/groovy/com/jdbernard/net/GroovyDirectoryServer.groovy b/src/main/groovy/com/jdbernard/net/GroovyDirectoryServer.groovy index 169a6d5..c4fa627 100755 --- a/src/main/groovy/com/jdbernard/net/GroovyDirectoryServer.groovy +++ b/src/main/groovy/com/jdbernard/net/GroovyDirectoryServer.groovy @@ -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() {