Changed the return of runJetty so that callers can have the server object.
This commit is contained in:
1 parent
81b88344b3
commit
6ebe75402a
1 file changed
+4
-2
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user