You can't use localhost because you're running the app in your cellphone. The server is running on your computer. If you use locahost the app will understand that the server is running on your cellphone, which is not correct. Here's how you should do it:
That's because we only created the "users" route on this tutorial. Like this:
If you want to create the homepage route, you gotta add the '/' char, like this:
I am trying to fetch the data from '/users' and display it in the homepage.
You can't use
localhost
because you're running the app in your cellphone. The server is running on your computer. If you uselocahost
the app will understand that the server is running on your cellphone, which is not correct. Here's how you should do it: