Question:I am trying to use apollo-server-express to maintain a graphql endpoint and other endpoints to perform oAuth with twitter. I wanted to perform the oauth in the client in a way that a browser tab opens and a socket transmits a “MESSAGE” (as an example) from the callback to the server back to the main client window.
Here’s my index.js
Answer:It looks like you need to enable CORS for socket.io in order for it to work when using a different domain (and port).
Take a look at: https://socket.io/docs/v4/handling-cors/ for more information about how to handle Socket.IO CORS
If you have better answer, please add a comment about this, thank you!