Vue axios post request
axios.post(`${this.host}:${this.port}/apiv2/login`, {
body: {
userName: this.user,
password: this.pwd
}
});
resulted in ERROR:
Access to XMLHttpRequest at 'http://localhost:9047/apiv2/login' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
python requests, postman or simple curl does the job without errors
curl 'http://localhost:9047/apiv2/login' -H 'Content-Type: application/json' --data-binary '{"userName":"user","password":"pass"}'
UPDATE: Here my solution:
I added NodeJS server (localhost:8081). Now Vue (localhost:8080) is accessing NodeJS and NodeJS is quering Dremio API (localhost:9047).
The idea of having just static Vue app didn't work.