質問

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?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top