Laravel Cors blocking requisicoes Xios

Asked

Viewed 428 times

1

The configuration of my Laravel Cors is this.

'supportsCredentials' => false,
    'allowedOrigins' => ['*'],
    'allowedHeaders' => ['*'],
    'allowedMethods' => ['*'],
    'exposedHeaders' => [],
    'maxAge' => 0,
    'hosts' => [],

The configuration of my request is

axios.get('http://api2u.oo/api/rede/1', {
    headers: {
      'Access-Control-Allow-Origin': '*',
    },
    crossdomain: true
})
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });

Laravel 5.5.*

The mistake

inserir a descrição da imagem aqui

How to solve?

1 answer

1


Failed to register CORS as a middleware for the api.

Browser other questions tagged

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