As you can see in the documentation for Configuration , the default port is 9000.
That means you should be able to do
val port = Play.current.configuration.getInt("http.port").getOrElse(9000)
But for this you will need to run the application using
> run -Dhttp.port=9001
There may be other ways, but this is one possible solution.
maba source share