You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hey Francisco, I'm trying to implement a socket.io real-time chat, similar to your tutorial. If I do this:
curl "<the server URL>/socket.io/?EIO=4&transport=polling"
it returns correctly, so the backend is working. but I do get CORS error when trying to have my frontend make an API call to the backend, which is in a different port.
I'm not sure what this CORS error is about; I already have the http://localhost:3000 (frontend) route whitelisted using the express cors package. (And it should be working since my other frontend api calls work)
The text was updated successfully, but these errors were encountered:
It's actually a super easy fix, we just have to add cors: {} to the list of options here, then we can pass the cors options for the socket io instance when instantiating the server:
hey Francisco, I'm trying to implement a socket.io real-time chat, similar to your tutorial. If I do this:
it returns correctly, so the backend is working. but I do get CORS error when trying to have my frontend make an API call to the backend, which is in a different port.
I'm not sure what this CORS error is about; I already have the
http://localhost:3000
(frontend) route whitelisted using the express cors package. (And it should be working since my other frontend api calls work)The text was updated successfully, but these errors were encountered: