0

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'},
  • In .angular-cli.json I set the outDir to wwwroot since that is what VS and IIS are usually looking for: --> "outDir": "wwwroot" – user2178025 Jan 25 '18 at 23:49
  • consider using [HashLocationStrategy](https://angular.io/guide/router#hashlocationstrategy) – R. Richards Jan 26 '18 at 00:00
  • Make sure you do a "ng build --prod" too before deployment. That will ensure that the core of your application is put together correctly and that there are no build errors. – RockGuitarist1 Jan 26 '18 at 20:14

1 Answers1

0

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
Kyle Barnes
  • 729
  • 3
  • 13
  • 22