在生产环境中使用ember CLI构建 [英] Building with ember CLI in production environment
问题描述
运行的余烬服务器在我的开发机器上本地工作正常,但是如何在主机上运行呢?我所能做的就是上传dist文件夹,其中包含CLI生成的输出。但是,当我导航到它时,会出现空白页。
Running ember server works fine locally on my dev machine but how do I do it on my host? All I can do is upload the dist folder which contains the output of the CLI build. But when I navigate to it there is a blank page.
推荐答案
Ember serve / server / s会启动用于本地开发的服务器,则不应使用其文件将其部署在实时主机上。
Ember serve/server/s fires up a server for local development, you shouldn't use it's files to deploy on a live host.
启动服务器。默认端口为4200。使用--proxy标志将所有ajax请求代理到给定地址。例如,ember服务器--proxy
http://127.0.0.1:8080
会将您所有的应用XHR代理到运行在端口8080的服务器。
Starts up the server. Default port is 4200. Use --proxy flag to proxy all ajax requests to the given address. For example ember server --proxy
http://127.0.0.1:8080
will proxy all your apps XHR to your server running at port 8080.
要部署时,您需要构建文件以进行concat / min / uglify操作,因此您需要运行 ember build --environment production
根据您的需要更改环境。
When you want to deploy you will need to build your files in order to concat/min/uglify for that you will need to run ember build --environment production
change the env depending on your needs.
根据环境构建应用程序。
Builds the application depending on the environment.
要了解有关ember-cli命令的更多信息,请参考文档的本部分。
To learn more about ember-cli commands refer to this section of the docs.
这篇关于在生产环境中使用ember CLI构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!