I am trying to make call from vuejs project to adonis js using proxy. My vue.config.js file is as bellow:
devServer: {
proxy: {
'^/api': {
target: 'http://127.0.0.1:3333',
secure: false,
changeOrigin: true,
pathRewrite: {
'^/api': '/api'
},
logLevel: 'debug',
headers: {
Connection: 'keep-alive'
},
}
}
},
This configuration is working when I am trying to login with wrong credential, then backend adonis project is returning properly. But when I am trying with correct credentials, It throws this message:
Proxy error: Could not proxy request /api/admin/login from localhost:8080 to http://127.0.0.1:3333. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNRESET).
I have tried in many different ways by changing proxy configuration, but it is not solved yet. If need any more information, feel free to ask.