You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I run run-s build api, Vue is built for production, served up on localhost:3333, and the connection to the api works flawlessly.
But if I run run-s serve api, Vue is served up for dev on localhost:8080, and I get this error when trying to hit the api via the devServer proxy:
Proxy error: Could not proxy request /api/ from localhost:8080 to http://localhost:3333 (ECONNREFUSED).
I've searched around for answers, and I've found a handful, but they've all been suggested by people with the caveat "it works, but I'm not sure why", and none of them work for me.
Here are the changes I've tried already:
devServer: {proxy: {'^/api': {target: 'http://127.0.0.1:3333',/* tried changing localhost to 127.0.0.1 */target: 'http://[::1]:3333',/* tried changing localhost to [::1] */secure: false,/* tried adding this */changeOrigin: true/* tried adding this */}}},
Any help would be greatly appreciated, thanks! (Originally posted on Spectrum.)
The text was updated successfully, but these errors were encountered:
I've started a project based on this template, and I'm struggling with the devServer proxy. Here's the relevant config:
package.json
vue.config.js
my issue
I've searched around for answers, and I've found a handful, but they've all been suggested by people with the caveat "it works, but I'm not sure why", and none of them work for me.
Here are the changes I've tried already:
Any help would be greatly appreciated, thanks!
(Originally posted on Spectrum.)
The text was updated successfully, but these errors were encountered: