Error with Laravel being used with API

Asked

Viewed 23 times

0

I have an application in vuejs that requests for Windows on localhost, but when I put both on the server (each one on a server) it is not possible to request. This error appears:

net::ERR_SPDY_PROTOCOL_ERROR

I looked in some places and it’s something to do with CORS

Edit 1:
CORS:

'supportsCredentials' => true,
    'allowedOrigins' => ['*'],
    'allowedOriginsPatterns' => ['*'],
    'allowedHeaders' => ['*'],//['Content-Type', 'X-Requested-With'],
    'allowedMethods' => ['*'],
    'exposedHeaders' => ['*'],
    'maxAge' => 0,

1 answer

0

You need to configure CORS in your project to manage access to your application. There is a library that does the heavy lifting for you leaving only a few settings to be performed.

I’ll leave the library documentation link which is very simple to follow: barryvdh/Laravel-Cors

  • I use this Cors, and it’s allowing everything. See the code in Edit 1

Browser other questions tagged

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