如何在生产模式下运行?

ide*_*xer 18 playframework

我该怎么跑Play!在生产模式下,如果发生异常,它不会将源代码打印到浏览器窗口?

Jul*_*ont 20

有几种方法,最简单的方法是运行play start而不是play run.

您可以在文档中找到更多信息:在生产模式下启动应用程序

  • 我做`干净的编译阶段'然后通过`/ sbin/start-stop-daemon -start --exec \`pwd \`/ target/start --background - -Dhttp.port = 9090`启动结果 (2认同)

man*_*ana 15

而在SBT控制台是,你还可以运行在PROD模式下您的应用程序

[my-first-app] $ testProd
Run Code Online (Sandbox Code Playgroud)

同样有用的是使用此命令来阻止在按CTRL+ 时退出sbtD

[my-first-app] $ testProd --no-exit-sbt
Run Code Online (Sandbox Code Playgroud)

Play 2.6中,testProd被重命名为runProd:

[my-first-app] $ runProd
Run Code Online (Sandbox Code Playgroud)

  • In Play 2.6.x, the task has been renamed to `runProd`. (5认同)