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

234
Views
error de retorno de la solicitud posterior de axios: solicitud de origen cruzado bloqueada

Estoy usando axios para publicar algunos datos en mi servidor de nodos, pero me da este error:

 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at MY_NODE_URL. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

este es mi código:

 const url = "https://blooming-escarpment-74540.herokuapp.com/blog/postBlog"; axios .post(url ,{ title: document.getElementById("title").value, post: document.getElementById("post").value, blogImage:document.getElementById("blogImage").files[0], }) .then((response) => { const result = response.data; if (result.status == "SUCCESS") { console.log("SUCCESS"); } else { console.log("BAd"); } }) .catch((error) => { console.log(error); });

este error aún se muestra incluso si uso la fetch API o incluso XHR

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

tienes que instalar el paquete cors en tu node js backend

Uso

 const express = require('express') const cors = require('cors'); const app = express(); app.use(cors());
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!