How do we write a webpack configuration that allows us to perform a successful AJAX (get) request on a www.example.com/api/books
domain/url which doesn't have CORS setup/enabled?
Based on this question.
The error I get from the domain is: No 'Access-Control-Allow-Origin' header is present on the requested resource.
What I attempted was adding this object to my webpack.base.conf.js
file:
proxy: {
'/api': {
target: 'http://www.example.com',
secure: false
}
}
and adapted my http root url from:
Vue.http.options.root = 'http://www.example.com/api/'
to:
Vue.http.options.root = '/api/'
But it doesn't seem to be taken into account during my AJAX request:
GET http://localhost:8080/api/public/v1.0/lists/movies/in_theaters.json (Not Found)