使用播放开始和播放运行有什么区别? [英] What's the difference between using play start and play run?

查看:128
本文介绍了使用播放开始和播放运行有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用播放框架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 startplay 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆