Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

540
Views
ajuste cors en strapi 4

Estoy usando strapi 4 como localhost y tengo un problema con la configuración de cors cuando agrego nuevos activos a través de url

La carga de imágenes toma un error de CORS Access to XMLHttpRequest at 'https://www.countrysideveterinaryclinic.org/sites/default/files/interesting-cat-facts.jpg' from origin 'http://localhost:1337' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

La solución de aquí no ayudó

mi middleware.js

 module.exports = [ 'strapi::errors', 'strapi::security', 'strapi::poweredBy', { name: 'strapi::cors', config: { enabled: true, header: '*', origin: ['http://localhost:1337'] } }, 'strapi::logger', 'strapi::query', 'strapi::body', 'strapi::session', 'strapi::favicon', 'strapi::public', ];
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Encontré la solución yo mismo, tal vez ayude a alguien.

middlewares.js

 module.exports = [ 'strapi::errors', 'strapi::security', 'strapi::poweredBy', { name: 'strapi::cors', config: { enabled: true, headers: '*', origin: ['http://localhost:1337', 'http://example2'] } }, 'strapi::logger', 'strapi::query', 'strapi::body', 'strapi::session', 'strapi::favicon', 'strapi::public', ];
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!