Skip to content

Instantly share code, notes, and snippets.

@pgordon9
Created September 26, 2016 04:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgordon9/83d8977a527a58415f0f32a8042fdf70 to your computer and use it in GitHub Desktop.
Save pgordon9/83d8977a527a58415f0f32a8042fdf70 to your computer and use it in GitHub Desktop.
Get port the server is running on. JettyExample | parkergordon.io
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