How to configure create-react-app server to not redirect requests or URL stems?

480 Views Asked by At

I've used create-react-app to create a new application and have then run...

npm run eject

...in order to get full control over the application.

What I want to do is update the server so that I can use my own Express middleware configuration to set up Passport.js and Express Routing to authenticate against another repository (and Alfresco repository in this case) and then proxy all subsequent XHR requests through a function that attaches the session token.

The issue I'm having is that each XHR request automatically gets redirected back to "/index.html" (including any attempt to login).

I'm sure that there must be something relatively straight-forward to configure in the webpack dev server configuration but as I'm not sure what!

0

There are 0 best solutions below