Such as in react, we often pack all the routes into one html bundle. I expected to handle all the request route and redirected them to the index.html, is there some way to do it elegant?
As for now, I used those code to do it, but it not perfect way, for example, request for JSON files maybe also redirected unexpectly:
Such as in
react
, we often pack all the routes into one html bundle. I expected to handle all the request route and redirected them to theindex.html
, is there some way to do it elegant?As for now, I used those code to do it, but it not perfect way, for example, request for JSON files maybe also redirected unexpectly: