angulariis

IIS port numbers vs VS2022 port numbers


I have downloaded a template from https://github.com/Njabulo240/IdentityHub. It is using Angular 18, .NET 8 and SQL backend. My environment is VS2022 and VSCode. The app runs well in my VS2022 dev environment. However, when I publish it to my local IIS it doesn't work any more (Local IIS and my VS2022 are in the same machine running Win10). My localhost is using port 80 and https://localhost is using port 443. In the application is using ports 4200 and 5296. Can any one out there "EDUCATE" me between ports in IIS vs ports in VS2022? How and what it happens when I published to IIS environment?

This issue causes me a lot troubles since there is not many explanations when almost no one talked about publishing app to IIS.

Thanks. Appreciate for any input.


Solution

  • remove hard code port number and add proxy config to the project. The proxy will correct url and port number in the IIS. for example instead of calling service this.url/api/update/amployee, I need just put /api/update/employe The proxy will pad url for me. Hard code is the bad practice