A Play Framework provides commands to package and deploy Play applications in production.
The run
command, which we used earlier, starts the application in DEV
mode and watches the code for changes. When there is a change in the code, the application is recompiled and reloaded. Being watchful is handy during development, but is an unnecessary overhead in production. Also, the default error pages shown in PROD
mode are different from the ones shown in DEV
mode, that is, they have less information about the errors that are occurring (for security reasons).
Let's look at the different ways in which we can deploy an application in production.
To start an application in PROD
mode, we can use the start
command:
[PlayScala] $ start [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 24353 [info] play - Application started (Prod...