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

153
Views
No hay un encabezado 'Access-Control-Allow-Origin' en el recurso solicitado cuando hay un encabezado en la fuente solicitada

Perdón por hacer esta pregunta cuando ya hay muchas respuestas a estas preguntas, pero he intentado casi todo y todavía no funciona. Estoy haciendo una llamada de API a una API alojada en repetición. Esto ha funcionado bien hasta ayer, no sé qué hice ayer que arruinó mi código. Al realizar la llamada a la API, aparece el error CORS: No hay un encabezado 'Access-Control-Allow-Origin' en el recurso solicitado, pero tengo un encabezado con 'Access-Control-Allow-Origin' en mi respuesta.

Realmente aprecio toda su ayuda!

Código API:

 app.use(bodyParser.urlencoded({ extended: true })) app.use(bodyParser.json()) app.use(cors()) app.post('/invoicing', cors(), async (req, res) => { res.header('Access-Control-Allow-Origin', '*'); res.header('crossorigin', 'true') res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); try { const product = await stripe.products.create({ name: 'Test' }) const price = await stripe.prices.create({ product: product.id, unit_amount: 10000, currency: 'nok', }) const customer = await stripe.customers.create({ name: 'Daniel Olsen', email: 'olsen.daniel04@gmail.com', description: 'Customer', }) const invoiceItem = await stripe.invoiceItems.create({ customer: customer.id, price: price.id, }) const invoice = await stripe.invoices.create({ customer: customer.id, auto_advance: true, }) const invoiceFinalize = await stripe.invoices.finalizeInvoice(invoice.id) console.log(invoiceFinalize) console.log(customer) res.json({ success: true, message: 'Yeeet' }) } catch (error) { console.log(error) res.json({ message: "Payment failed", success: false }) } })
about 4 years ago · Juan Pablo Isaza
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!