React agent request report 4040

react requests the server across domains. Configure proxy in package.json. The request can reach the server, but the front end reports 404.Why?

clipboard.png

clipboard.png

clipboard.png

Apr.21,2022

can you directly use http://localhost:7001/user/register request to try?

if it doesn't work, there's something wrong with this background.

if it works, restart your react service. (restart is required to modify the configuration of proxy in package.json)


proxy configuration problem.

proxy: {
    '/.+': {
        target: 'http://localhost:7001',
        changeOrigin: true,
        pathRewrite: {
            '^/': ''
        }
    }
}
Menu