Question

Could anyone explain why when I click on a link my angular views get shown fine but when I type in an address into the address bar in the browser (which is the same as where the links that work point to) such as localhost:8080/login I get a Cannot GET /login message.

My routes are set up in Angular and I'm using Node and Express 3 on the back-end.

What silly mistake am I making?

Était-ce utile?

La solution

Most likely you're getting angular and your webserver mixed up.

The webserver probably doesn't know to server your angular base page when the /login URL is entered. You need a catch-all handler on your nodejs server.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top