Created
September 26, 2016 04:13
-
-
Save pgordon9/83d8977a527a58415f0f32a8042fdf70 to your computer and use it in GitHub Desktop.
Get port the server is running on. JettyExample | parkergordon.io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.eclipse.jetty.server.{NetworkConnector, Server} | |
object JettyExample{ | |
{...} | |
def port() = { | |
val conn = server.getConnectors()(0).asInstanceOf[NetworkConnector] | |
conn.getLocalPort() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment