49

Angular 5 and ASP.NET Core

 5 years ago
source link: https://www.tuicool.com/articles/hit/3yIfima
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

A routed application should support “deep links”. A deep link is a URL that specifies a path to a component inside the app. For example, http://www.mysite.com/users/42 is a deep link to the hero detail page that displays the hero with id: 42.

There is no issue when the user navigates to that URL from within a running client. The Angular router interprets the URL and routes to that page and hero.

But clicking a link in an email, entering it in the browser address bar, or merely refreshing the browser while on the hero detail page — all of these actions are handled by the browser itself, outside the running application. The browser makes a direct request to the server for that URL, bypassing the router.

A static server routinely returns index.html when it receives a request for http://www.mysite.com/ . But it rejects http://www.mysite.com/users/42 and returns a 404 - Not Found error unless it is configured to return index.html instead.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK