简体   繁体   English

将Angular 5部署到IIS服务器,从dist文件夹导航的路由不起作用

[英]Angular 5 deployment to IIS server , navigation routes from dist folder not working

From what I understand, if I do an ng build and deploy the code generated in the "dist" folder, then all the typescript and routing is all ready to work?! 据我了解,如果我要构建并部署在“ dist”文件夹中生成的代码,那么所有的打字稿和路由都准备好了吗?

I deployed code in dist folder and the home page comes up just fine 我在dist文件夹中部署了代码,主页显示的很好

as soon as I click on a link, I get a 404 ( IIS server) 单击链接后,我立即得到404(IIS服务器)

example of a route 路线示例

/criminal/?UserID...


{ path: 'criminal', component: CriminalComponent, pathMatch: 'full'},

You should follow this tutorial: 您应该遵循本教程:

https://blog.angularindepth.com/deploy-an-angular-application-to-iis-60a0897742e7 https://blog.angularindepth.com/deploy-an-angular-application-to-iis-60a0897742e7

At a high level: 在高层次上:

  1. Install URL Rewrite 安装URL重写
  2. Handle subfolder and base URL as needed 根据需要处理子文件夹和基本URL
  3. Add web.config file to be deployed when you do an ng build 在执行ng build时添加要部署的web.config文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular项目(dist文件夹)部署在Websphere应用服务器 - Angular project(dist folder) deployment in Websphere Application server Angular4 + MVC + cli +使用cli build命令生成的dist文件夹进行部署 - Angular4 + MVC + cli + deployment using dist folder generated from cli build command 将dist文件夹部署到tomcat服务器上时,angular2路由不起作用 - angular2 routing not working when you deployed dist folder onto tomcat server 从dist文件夹恢复Angular 4项目 - Restore Angular 4 project from dist folder 为什么我从运行指向Angular应用程序的/ dist文件夹的节点服务器时得到空白页? - Why I'm getting a blank page from running a node server that point to the /dist folder of an Angular app? Angular 到 IIS 服务器的通用部署给出错误 - Angular Universal Deployment to IIS server giving error 与客户端导航/路线分开的Angular 2管理员导航/路线 - Angular 2 Admin navigation/routes separate from Client side navigation/routes 已从角度5更新为角度6,并且无法再建立dist资料夹 - updated from angular 5 to angular 6 and can't build a dist folder anymore 无法使用WAMP服务器中的dist文件夹部署Angular 5 - Unable to deploy Angular 5 using dist folder in WAMP server 从AngularJS dist文件夹创建符号链接到另一个Angular.io dist文件夹 - Create symlink from AngularJS dist folder to a different Angular.io dist folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM