Comments (3)
It turns out I needed to add the following line inside my router.post and router.get for bookings.js on the server:
res.header("Access-Control-Allow-Origin", "http://localhost:8081");
Any idea why you didn't have to add this at all and yet it still worked for you? This issue can be closed, but I am curious as to why. Thanks again for putting this series together.
from taxiapp.
The real issue had nothing to do with cors. I was still hitting the issue, the below explains that for Android I have to use the IP address of my machine since it is an emulator as opposed to iOS which is a simulator. Hope this helps someone else:
The thing is, that iOS is running in a simulator and Android is running in an emulator.
The localhost is pointing to the environment in which the code is running. The emulator emulates a real device while the simulator is only imitating the device.
Therefore the localhost on Android is pointing to the emulated Android device. And not to the machine on which your server is running.
The solution is to replace localhost with the IP address of your machine.
from taxiapp.
I changed localhost to my machine IP and it worked for me....
from taxiapp.
Related Issues (11)
- Hi
- error in node modules
- react-native-fcm:compileReleaseJavaWithJavac FAILED
- Setting up redux didn't work HOT 16
- Always got issue 4968: Modue doesn't exists in the module map
- Error: Check the render method of `App` HOT 1
- toggleSearchResultModal is not a function error HOT 2
- Build Failed HOT 1
- Build failed HOT 1
- would be appreciated if a payment gateway, OTP would have been implemented
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from taxiapp.