简体   繁体   中英

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?!

I deployed code in dist folder and the home page comes up just fine

as soon as I click on a link, I get a 404 ( IIS server)

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

At a high level:

  1. Install URL Rewrite
  2. Handle subfolder and base URL as needed
  3. Add web.config file to be deployed when you do an ng build

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM