How to change the default port from 9000 to 9001 in Play 2.5.9?
Tried following steps
But this works activator run -Dhttp.port=9001 -Dhttp.address=127.0.0.1
Can we change it from application.conf instead of specifying port from command line?
We are using Play version 2.5. 6. For changing the port, go to your project root folder and hit: activator "run 8008" in command prompt / terminal.
Specifying the HTTP server address and port The default is to listen on port 9000 at the 0.0. 0.0 address (all addresses).
In a way, no you can not add HTTP server setting in application.conf
in reload mode (activator run
).
In run
mode by the time the play server starts, your application.conf
is not resolved yet, but if you use state
it works fine.
If you want to avoid providing port everytime you run the command, you could add it in build.sbt
as following.
PlayKeys.devSettings := Seq("play.server.http.port" -> "9001")
It is explained here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With