问题
For some reasons (e.g Hiding the # from the user), we would like to use PathLocationStrategy as the routing strategy for our Angular 8 Application.
We are about to fallback to index.html while deploying the application to an Nginx server. But the problem we are facing is, when we run ng serve locally, the application won't bootstrap when page is refreshed.
I have tried to use a custom webpack config to enable devServer.historyApiFallback, it doesn't work.
I have also read through quite a few docs like this, but no luck
Is there any workaround to spin up a local server that supports the PathLocationStrategy better? Thanks!
来源:https://stackoverflow.com/questions/56863628/how-to-run-ng-serve-with-pathlocationstrategy-while-falling-back-to-index-html-w