Changed the return of runJetty so that callers can have the server object.
This commit is contained in:
parent
81b88344b3
commit
6ebe75402a
@ -34,10 +34,10 @@ public class GroovyDirectoryServer {
|
|||||||
rewriteRules: opts.r ?: [],
|
rewriteRules: opts.r ?: [],
|
||||||
groovyPatterns: opts.g ?: ["*.groovy"] ]
|
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 server = new Server(options.port)
|
||||||
|
|
||||||
def handler = new ServletContextHandler(ServletContextHandler.SESSIONS)
|
def handler = new ServletContextHandler(ServletContextHandler.SESSIONS)
|
||||||
@ -73,6 +73,8 @@ public class GroovyDirectoryServer {
|
|||||||
server.start()
|
server.start()
|
||||||
|
|
||||||
println "Jetty started on port ${options.port}."
|
println "Jetty started on port ${options.port}."
|
||||||
|
|
||||||
|
return server
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getUsage() {
|
public static String getUsage() {
|
||||||
|
Loading…
Reference in New Issue
Block a user