skip to Main Content

I am in the process of upgrading my laravel application.
my old laravel using old version xampp.
Since new laravel 10 version require higher php version, I installed another newer xampp.

Everything works for both old and new laravel for website part using chrome.
I am using react native for mobile app using api part of laravel.
When I start laravel app with php artisan serve --host 127.0.0.1 --port=8010
My react native app fetching always return network error.
The api url is http://127.0.0.1:8010/api/user.

This only happen if I fetch from my react native app.
It works when I use same api on chrome, it return json. This works fine for both laravel on chrome.
and It also works if I fetch same api to my old laravel.
My old laravel using same url without the port, since both xampp version using different port.

Any idea whats wrong here?

1

Answers


  1. Chosen as BEST ANSWER

    turn out the solution is I need to map my computer and emulator port

    adb -s devicename reverse tcp:8010 tcp:8010
    

Please signup or login to give your own answer.
Back To Top
Search