CORS error when trying to authenticate an API on localhost

Asked

Viewed 48 times

1

I am trying to access my API that is on localhost. However, when trying to access it, I come across the following error:

Failed to load http://127.0.0.1:8000/api/login: The 'Access-Control-Allow-Origin' header contains Multiple values '*, *', but only one is allowed. Origin 'http://127.0.0.1' is therefore not allowed access.

You will need to configure something in particular in my apache or coding fault in my app-config.js (I am using Angularjs) ?

app-config:

(function () {
  'use strict';
   app.constant('AppConfig', {
    AppTitle: 'testeBase',
   ApiUrl: 'http://127.0.0.1:8000/api/'
  });
})();
  • I’m using xampp. Where can I find this code?

  • Your API, was developed in what language? Are you using any specific framework?

  • Ai ta saying that the header is set twice. Post the file code of the api you are accessing and maybe the file . htaccess

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.