[英]How I can use nginx as server for angular 6 application?
I want to open the browser index.html for the application that runs under nginx and then open the application for anguar-cli (angular 6).我想打开nginx下运行的应用程序的浏览器index.html,然后打开anguar-cli(angular 6)的应用程序。 Wherever I read it everywhere it says create the angular application and start him server.无论我在哪里读到它,它都会说创建角度应用程序并启动他的服务器。 I'm lost.我迷路了。 I think it's possible to work angular 6 using a server other than delivered in the Angular 6 box.我认为可以使用 Angular 6 盒子中提供的服务器以外的服务器来运行 angular 6。 If possible, tell me how.如果可以,告诉我怎么做。 Please help me understand the mechanism of the Angular 6.请帮助我理解 Angular 6 的机制。
You used the angular-clt tag, so i think with "server delivered in the Angular 6 box" you mean the one started with ng serve
.您使用了 angular-clt 标签,所以我认为“在 Angular 6 框中交付的服务器”是指以ng serve
开头的那个。
ng serve
just starts the development server with change detection and auto-rebuild for your source files und (without extra parameters) also builds a debug version of your angular appication. ng serve
只是启动带有更改检测和自动重建源文件的开发服务器,并且(没有额外参数)还构建了角度应用程序的调试版本。
To build the production files use要构建生产文件,请使用
ng build --prod
as described in https://github.com/angular/angular-cli/wiki/build or https://angular.io/guide/deployment and then copy the files from dist directory to your web server.如https://github.com/angular/angular-cli/wiki/build或https://angular.io/guide/deployment 中所述,然后将文件从 dist 目录复制到您的 Web 服务器。
If your application makes use of the router and you move it to a sub-directory of your server, you must take care of the correct <base href>
如果您的应用程序使用路由器并将其移动到服务器的子目录中,则必须注意正确的<base href>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.