Tim W
Tim W

Reputation: 53

Angular 2 - Set page/route http status code

Is it possible in Angular 2 to change the status of a page that is rendered to something other than 200?

For example, we have routes for both a "404" page, and a "500" page, and I want those routes to respond with the appropriate http status.

Google does something similar: going to www.google.com/thisisanerror, you can see in the network tab that that document returns a 404.

Google 404 page

Upvotes: 2

Views: 831

Answers (1)

Quentin
Quentin

Reputation: 944443

No.

Angular is a client side library. It can make HTTP requests (but they aren't directly connected to the URL shown in the address bar). It doesn't make HTTP responses. HTTP statuses are a feature of the response.

Upvotes: 1

Related Questions