I'm currently using devServer{proxy:{...}}
in vue.config.js to configure proxy for api calls for avoiding CORS problems in my application. It works fine when I run npm run serve
in localhost.
Now I need to deploy my application to a host, so I run npm run build
, change the url's of my Ajax calls and it's not running... So what I indeed need is to configure my proxy for deployment (build), not for devServer.
What is the correct way to do that?
I've already tried:
server{proxy:{...}}
and build{proxy:{...}}
, but none of them are allowed when running npm run build
.
Thank you!