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

238
Views
Intento conectar mi aplicación Expo al backend localhost pero no funciona

Mi servidor se ejecuta en localhost: 5000 y mi iPhone está conectado al servidor metro con el método de túnel usando Expo. Traté de cambiar localhost con la dirección IP de mi PC pero el registro es el siguiente:

 Network request failed at node_modules\whatwg-fetch\dist\fetch.umd.js:535:17 in setTimeout$argument_0 at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:383:16 in callTimers at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunction at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0 at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in callFunctionReturnFlushedQueue at [native code]:null in callFunctionReturnFlushedQueue

el código de mi función fetch es:

 const onSubmitHandler = () => { const payload = { phone, name, surname, password, city, dateOfBirth, }; fetch("http://192.168.1.40:5000/signup", { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(payload), }) [....] } } catch (err) { console.log(err); }; }) .catch(err => { console.log(err); }); };

y mi index.js del servidor es:

 import express from 'express'; import { createRequire } from 'module'; const require = createRequire(import.meta.url); import sequelize from './utils/database.js'; import router from './routes/routes.js'; const app = express(); app.use(express.urlencoded({ extended: true })); app.use(express.json()); app.use((_, res, next) => { res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE'); res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization'); next(); }); app.use(router); sequelize.sync(); app.listen(5000);

¿Cómo puedo solucionar este problema?

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!