使用播放开始和播放运行有什么区别? [英] What's the difference between using play start and play run?
问题描述
我正在使用播放框架2.0.4,
I am using play framework 2.0.4,
我注意到在项目文件夹中,如果使用play start
,则服务器的响应速度要比通过play run
启动的服务器快.但是,用户无法访问使用start
命令启动的服务器中public
文件夹下的静态资源,因此我想知道更改根目录还是要更改最初定义为的路由的start
默认配置是什么? :
I noticed that in the project folder, if I used play start
, the server responses faster than server started via play run
. However, user can not access static resources under public
folder in the server started using start
command, so I am wondering what's the start
default configuration that changing the root directory or do I need to change routes which originally defined as:
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.at(path="/public", file)
HEAD /assets/*file controllers.Assets.at(path="/public", file)
推荐答案
当您要在生产模式上部署应用程序时,应执行play start
命令.响应速度更快,因为自动重载类和其他开发支持功能默认情况下被禁用.
The play start
command should be executed when you want to deploy your application on production mode. It's response faster, because the auto-reloading-class and other development-supporting-features are disabled by default.
与play start
命令不同,play run
命令最好在开发模式上执行,因为它将启用所有 development-supporting-feature ,例如自动重新加载,eBean DDL生成等等.
Unlike play start
command, the play run
command is best executed on development mode because it will enable all development-supporting-feature like auto-reloading, eBean DDL generation, and so-on.
实际上,如果您在public/javascripts/jquery-1.9.0.min.js
上有一个javascript文件.即使使用play start
或play run
,您仍然可以访问URL http://yourdomain/assets/javascripts/jquery-1.9.0.min.js
,因为public/*
文件已映射到/assets/*
Actually, if you have a javascript file on public/javascripts/jquery-1.9.0.min.js
. You still can access to url http://yourdomain/assets/javascripts/jquery-1.9.0.min.js
even if you use play start
or play run
because the public/*
files are mapped to /assets/*
并且要注意,play start
命令正在后台中执行该过程,而play run
则不在.
And to be noticed that the play start
command is doing the process in background, while play run
not.
这篇关于使用播放开始和播放运行有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!