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

141
Views
Problema con el punto final del matraz de llamada de reaccionar

Quiero escribir una llamada de matraz simple desde reaccionar
Código de aplicación.js:

 import React, { useState, useEffect } from "react"; function App() { ... useEffect(() => { fetch(`http://127.0.0.1:5000/ `, {mode: "no-cors"}).then(response => response.json()).then(data => setResponseText(data.total)); }, [name]); ... return ( ... ); } export default App;

Código de matraz:

 from flask import Flask, Response, jsonify from flask_cors import CORS, cross_origin app = Flask(__name__) app.config['CORS_HEADERS'] = 'Content-Type' CORS(app) @app.route('/') @cross_origin() def hello_world(): # put application's code here r = Response("text", status=200) r.headers["Content-Type"] = "application/json" r.headers['Access-Control-Allow-Origin'] = '*' r.headers["Access-Control-Allow-Credentials"] = True return r if __name__ == '__main__': app.run(debug=True)

y error al buscar: App.js: 13 No capturado (en promesa) SyntaxError: final inesperado de la entrada

¿Qué estoy haciendo mal?

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!