Bitnami NODEJS stack with vue-cli API CORS HELP!

Access to XMLHttpRequest at ‘http://3.base.maps.api.here.com/maptile/2.1/maptile/cd2df3d9c4/normal.day/10/163/397/256/png8?xnlp=CL_JSMv3.0.17.0&app_id=null&app_code=null’ from origin ‘http://externalIP:8080’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

I have rad and tried everything to get this API working but still receive lots of errors like the above.

Please hep, this one is killing me!

If you are getting CORS error from third party API only thing you can do is proxy it thro your own server that adds required CORS headers.

Configuration will differ based on your server. Do you have something like Nginx, Apache, HAProxy or something similar in front of NodeJS?

Hey Mcsneaky, using Apache.

I don’t remember anything about Apache, but here seems to be something: https://chriscarey.com/blog/2014/06/13/apache-proxy-with-cors-headers/

You can search for “Apache CORS proxy”

I had this problem using Nuxt.js aswell but only on client side, I solved it by fetching the data with fetch() instead of axios.

          await fetch(url)
          .then((resp) => resp.json())
          .then(function(data) {
            // do shit
          })

The obvious and correct solution would be using a proxy as mentioned above.