0

I host my code on digitalocean

Frontend use Nuxt js and Backend use Laravel

I test api using postman backend api ok

Error: strict-origin-when-cross-origin

modules: [
 // https://go.nuxtjs.dev/axios
 '@nuxtjs/axios',
 '@nuxtjs/sitemap',
 '@nuxtjs/proxy',
],

axios: {
 proxy: true,
 prefix: 'http://api.mydomain.com/api'
},

proxy: {
 '/api/': 'http://api.mydomain.com/api',
},
James
  • 1
  • 1
    you need to enable cors on your backend. what is your laravel version? – Mohammed Naguib Sep 12 '21 at 09:48
  • already enable, i test using postman the result ok, but online say error – James Sep 12 '21 at 10:22
  • Postman works because it bypasses CORS. Hence it's not blocked in Postman mainly because it's not client side but more of a server. You need to set CORS on Laravel. Voted for a close. – kissu Sep 12 '21 at 10:30
  • Does this answer your question? [Laravel 5.1 API Enable Cors](https://stackoverflow.com/questions/33076705/laravel-5-1-api-enable-cors) – kissu Sep 12 '21 at 10:30

0 Answers0