Problem: AdonisJS API not accessible from React Native (mobile device) even with LAN IP #5103
Unanswered
prince0xdev
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem: AdonisJS API not accessible from React Native (mobile device) even with LAN IP
Hello AdonisJS team 👋,
I am currently trying to connect a React Native (Expo) mobile application to my AdonisJS backend, but I am facing an issue where the API is not accessible from external devices (mobile phone), even when using my local network IP.
Environment
Current configuration
.envAPI base URL used in React Native
Issue
When I try to access the API from my mobile device or even from another device on the same network, I get:
Network Errorin React NativeHowever, the API works perfectly on:
http://localhost:3333(on the same PC)What I already tried
HOST=0.0.0.0in.envipconfigStill, the server is not reachable externally.
Question
Is there something additional required in AdonisJS to expose the server to LAN devices (React Native / mobile testing)?
For example:
server.tsorapp.ts?Any guidance would be greatly appreciated 🙏
Thank you!
It's my first time using Adonis, it's nice!
Beta Was this translation helpful? Give feedback.
All reactions