Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Play in production mode?

Tags:

How can I run Play! in production mode, so that it doesn't print source code to the browser window in case of an exception?

like image 797
ideaboxer Avatar asked Jan 19 '13 09:01

ideaboxer


People also ask

How do I run a Play framework?

To run a Play application: Create a new Run Configuration – From the main menu, select Run -> Edit Configurations. Click on the + to add a new configuration. From the list of configurations, choose “sbt Task”

How do I change port Play framework?

Go to the project directory and just say play (and nothing after that). That will open the play console. Next, say run 8080. That will start play on port 8080.

Which command must be used to build an application in production mode in angular?

To build your application for production, use the build command. By default, this command uses the production build configuration. This command creates a dist folder in the application root directory with all the files that a hosting service needs for serving your application.


2 Answers

There are several methods, the easiest way is to run play start instead of play run.

You can find more information on the documentation: Starting your application in production mode

like image 144
Julien Lafont Avatar answered Oct 07 '22 23:10

Julien Lafont


While being in the sbt console, you can also run your app in Prod mode with

[my-first-app] $ testProd

Also useful is to use this command to prevent sbt exiting when pressing CTRL+D

[my-first-app] $ testProd --no-exit-sbt

In Play 2.6, testProd was renamed to runProd:

[my-first-app] $ runProd
like image 21
mana Avatar answered Oct 08 '22 00:10

mana