1

I'm getting an error: "Cannot GET /main" when I access this address: "http://localhost/main" I attach pictures of my code after ng build

I moved the created folder (named client) after ng build to the server

I hope you can help me Thank you my code

2 Answers2

0

I think your express server is not redirecting to your index.html.

You can also use the routing with hash.

More details can be found here

Angular static Base URl and routing with useHash=True

Stefan Fenn
  • 483
  • 5
  • 13
0

Could you share a picture of the main.component.ts please. The error occurs because it cannot find Maincomponent

enter image description here

I reckon the error comes because you have mispelt the main.components export.