Vue-resource: How can i solve No 'Access-Control-Allow-Origin' header is present on the requested resource problem ?

Created on 2 Jun 2017  路  3Comments  路  Source: pagekit/vue-resource

How can i solve No 'Access-Control-Allow-Origin' header is present on the requested resource problem ? Can you help me for this issue ?

Most helpful comment

I believe you should adjust the backend to allow the requesting origin to the cors. If you are using nodejs you can use npm install cors.

All 3 comments

Hi @mrokt,

What platform / language are you using in back-end? You need to enable in your back-end app external access in your back-end.

If you're using Nodejs / Express just create a Middleware like this:

app.use("/your/api/path", (req, res, next){
       res.header("Access-Control-Allow-Origin", "*");
});

i'm not using backend. Making a API call with Vue.js. Getting cors error.

I believe you should adjust the backend to allow the requesting origin to the cors. If you are using nodejs you can use npm install cors.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

facesea picture facesea  路  5Comments

santigraviano picture santigraviano  路  5Comments

jiyifun picture jiyifun  路  3Comments

ionutvelicu picture ionutvelicu  路  5Comments

Creabine picture Creabine  路  3Comments