I come from a play 1.2.7 application and currently getting started with play framework 2.4.1 and scala. For a start I use the activator web ui to manage applications and the
Add the following to build.sbt of your project where <port>
should be replaced with your desired port number.
build.sbt
fork in run := true
javaOptions in run += "-Dhttp.port=<port>"
Expected console output in Activator UI on run
Setting up Play fork run ... (use Ctrl+D to cancel)
--- (Running the application, auto-reloading is enabled) ---
p.a.l.c.ActorSystemProvider - Starting application default Akka system: application
p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:<port>
(Server started, use Ctrl+D to stop and go back to the console...)
Through the application.conf
in production:
play.server.http.port = 80
When you run the application with SBT:
PlayKeys.devSettings := Seq("play.server.http.port" -> "80")
Using run
command:
$ run 80
For more details please refer the below links:
documentation-Config File
documentation-Server configuration options
Just a short note concerning the run
command (tested with Play! 2.4):
At least on Windows activator run -Dhttp.port=80
does NOT work, but
activator
(hit enter) and then run -Dhttp.port=80
works
Try this out:
activator "run 9500"
in terminal from your project folder.
This command work for me guys:
activator "~run 3333"