C#C
C#2y ago
M B V R K

How to redirect Angular requests to ASP.NET Core backend host

Hi guys,
I'm working on a project using Microservices.
One of the services called FrontEndService.WEB, it is a ASP.NET Core Angular project.
The general idea about the project it is that the project is a URL Shortener.
In that service, exactly in the Angular part, I have a page which the user enter then write the URL then the app shorten the url perfectly, at this point everything working fine.

The issue :
The Asp.net core backend working on this host https://localhost:7166/ and the Angular frontend working on the https://localhost:44482/ host (they're both on the same project)

The real-issue here is I want for example after shorten an url for example https://github.com/MbarkT3STO to be https://localhost:44482/udRMtM2o, now I want every request to that shortened url to redirect the user to https://localhost:7166/udRMtM2o where localhost:7166 is the host of the ASP.NET Core backend.

I hope that I well cleared my idea and issue.
So, please is there any way to configure the Angular part to automatically redirect any localhost:44482/shortCode to localhost:7166/shortCode??? of course except the home shortening page on localhost:44482/Shorten

Please if you have any idea to solve this issue share it with me and massive thanks in advance <3
Was this page helpful?