-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORS localhost loading props but calling ip not working #529
Comments
Have you tried to CORS options as specified here? http://docs.apollostack.com/apollo-client/index.html#corsSupport Otherwise, it might be that your server doesn't accept CORS requests. How have you hooked up GraphQL to your web server? |
@stubailo i tried this:
what im trying to do is to get is |
Hmm, I think this definitely should be in One option is to simply not use the |
@stubailo The CORS support link is broken. Any help with this? I am using all npm packages in a Meteor app but getting the same error. Server is running fine at localhost:8080/graphql |
Having the same problem, would love for the docs to have an example of how to enable cors. In the meantime, this thread fixed my issue: import cors from 'cors';
//FIXES CORS ERROR
const whitelist = [
// Allow domains here
'http://localhost:3000',
];
const corsOptions = {
origin(origin, callback){
const originIsWhitelisted = whitelist.indexOf(origin) !== -1;
callback(null, originIsWhitelisted);
},
credentials: true
};
graphQLServer.use(cors(corsOptions)); |
I have the same bug with Express and React |
Before upgrading Apollo/Meteor i could access my app from localhost:3000 or from other computer using my IP or from my computer using my own private IP. Now i can see the React dom but is not loading any data.
i can access my_ip:3000/graphql
is there any new configuration im missing ?
Thanks !
The text was updated successfully, but these errors were encountered: