-
Webpack 5 devServer proxy config and pathRewrite for context matching, CORS policy
In web front-end development, with the devServer proxy in Webpack, we have some useful configs. CORS policy devServer.proxy We can use this config devServer proxy for the SPA calling the API without CORS policy "The browser console will present an error like "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at…
-
SPA get 404 error when refreshing the page or access directly and SEO?
When developing and deploying SPA app, eg: Reactjs, the navigation between pages works perfectly by clicking through several routes and everything seemed fine. Somehow the URL looks like: http://abc.com/job/431 …until we refreshed the page or tried to access a route directly. We got a 404 error. One of working around solution: Use HashRouter instead of…