Angular2 / Cannot GET /page_name

cannot get / angular 8
cannot get / angular visual studio
cannot get / error in angular 7
cannot get / angular 7
cannot get / angular 6 .net core
cannot get / angular .net core
cannot get error in angular 2
cannot get / error in angular 8

I have created angular2 application, configures with routes. Pages open fine via browser. However when I try GET request via (e.g. postman) I get "Cannot GET /page_name" message. Error 404. If I run GET request against main url (localhost:4200) I get OK status with the html contents from index.html

Am I missing something?

Thank you for your time.

Update:

To give more context to the question. I have implemented OAuth2 authentication with implicit grant. The enters user/password for authentication against Spring (that's the backend) once it's authenticated OAuth2 token is generated with implicit grant. The problem is that implicit grant represents the token in URL (redirect_uri) as hash fragment (anchor) "#". As such the value must be parsed on client side. My redirect_uri is set to go back to the angular application login page (http://localhost:4200/login) with the token in the URL. And the redirect it fails with 404. I tested directly to access http://localhost:4200/login via postman and I got same 404 error. Accessing http://localhost:4200 returns index.html source html.

Angular operates in the realm of single page applications so essentially when you run an angular application, the only way to access the application is to go the the index page which is specified in the base_ref attribute in index.html.

When you query to the index page, then you can route the application using your specific configuration of routes. Again, the main page is loaded from index.html and once you are on the application itself you can route from there on out.

If you want to query to a particular page on your application via Postman you could send some URL parameters with your request and on your main page of your application, parse out the URL parameters and send your user to the page with something like this:

this.router.navigate(['/example'])

Since you're running this on your localhost, you will be able to reach the page in the browser but you won't be able to do a GET from Postman with something like http://localhost:4200/example unless you do some internal routing with your application.

Angular gives me Cannot GET / page_name While reloading · Issue , i did a application using MEAN Stack, while reloading page using browser an getting Cannot Get / page app.js var myApp  GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up Angular gives me Cannot GET / page_name While reloading #1280

Can you please specify what url you are accessing, generally in angular the routes are localhost:4200/path

where path is the path you have specified for that page in your routes configuration for eg.

const appRoutes: Routes = [
   { path: 'Product', component: Appproduct },
   { path: 'Inventory', component: AppInventory },
];

Your url should be http://localhost:4200/Product

Angular2 / Cannot GET /page_name - angular - html, However when I try GET request via (e.g. postman) I get “Cannot GET /​page_name” message. Error 404. If I run GET request against main url (localhost:​4200) I  I am trying to open, build and run someone else's Angular 4 project but I am not able to view the project when I run it my way. I don't see what is going wrong or what I should do now. I already had

What I think am going to do is instead of sending GET request to Spring to authenticate I will redirect the user to the Spring login page, once authenticated it will redirect back to Angular. My whole idea was to send the login request to Spring from Angular itself. But, I think this approach should do it.

User hits Angular login page, if token does not exist the user is redirected to Spring login page. Once authenticated the user is redirected back to Angular login page and which point the request should come with token and it will processed by Angular login page component (to added it in storage etc.)

Angular 2 Routing : 404 page not found on refresh, Angular 2 Routing : 404 page not found on refresh More @ https://drex44.​github.io If you can't read any story due to the WALL then DM me @Twtr. Follow  Cannot GET / in Angular I was playing with the quick start tutorial from Angular’s setup page on their web site. Using the file/folder layout on their THE HERO EDITOR I removed all folders/files not listed in their diagram.

Angular cannot get, We'll also see how we can do basic authentication for an Angular 2 app. x, a key Sign up Angular gives me Cannot GET / page_name While reloading  Continue browsing in r/Angular2 r/Angular2 Angular is Google's open source framework for crafting high-quality front-end web applications. r/Angular2 exists to help spread news, discuss current developments and help solve problems.

Angular cannot get, Get Started with Angular 2 Pt 2: MOAR Subcomponents – One Hungry Mind - […] lesson Sign up Angular gives me Cannot GET / page_name While reloading  I have the root route and it works fine. I also have a another route 127.0.0.1:3000/dashboard if I just type that url into the address bar I get this error: Cannot GET /dashboard If I create a li

Setting border-width with NgStyle in Angular 2+, Quabr answers we find · Explore tags Setting border-width with NgStyle in Angular 2+. 2019-10-10 I can't seem to set my borders with ngStyle : [ngStyle]=​"{  i did a application using MEAN Stack, while reloading page using browser an getting Cannot Get / page app.js var myApp = angular.module('Grunt', ['ngRoute']). config

Comments
  • re: parse out the URL parameters and send your user to the page with something like this where should I add that logic? To app.component.ts (tried it did not work)? Via postman if I try GET against localhost:4200 I get index.html source html. If I try localhost:4200/somepage I get "Cannot GET / page_name
  • I've added more explanation on why do I need this.
  • I am trying to access localhost:4200/login. Url works fine when opened in browser, but postman returns 404. I've also added more explanation on what I am trying to achieve (see question's update).
  • The URL will not load in postman, because the angular application is a single page application. The url loads fine on the browser because the javascript executes on the browser and loads the partial. But while accessing the page through postman, it will get the source of the page only
  • Yep, got that. Makes sense.