Search code examples
angularwakanda

Reloading page on Angular-Wakanda webserver gives 404


I'm guessing that when you reload the page, the Wakanda server is looking for an absolute path to a file in the web root. So if I reload the page https://my-site.com/home/products, there isn't an actual file at that location since I've used the Angular router to virtually create that path.

Is there anything I can do to fix this?


Solution

  • I found the answer in another stackoverflow post:

    In short, in app.module.ts, make sure your router is set up to use the hash in its pathing: RouterModule.forRoot(routes, { useHash: true })