Configuring for production

The Play Framework understands that applications may require changes in configuration prior to deployment in production. To simplify deploying, the command to deploy the application also accepts application-level configurations as arguments:

[PlayScala] $ start -Dapplication.secret=S3CR3T
[info] Wrote /PlayScala/target/scala-2.10/playscala_2.10-1.0.pom

(Starting server. Type Ctrl+D to exit logs, the server will remain in background)
 
Play server process ID is 14904

Let's change the application's HTTP port as follows:

#setting http port to 1234
[PlayScala] $ start -Dhttp.port=1234

In some projects, the production and development configuration are maintained in two separate files. We could either pass one or more configurations ...

Get Mastering Play Framework for Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.