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
{{ message }}
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.
When I try to use XMLHttpRequest to POST data to /api/events, I get an error related to CORS in the browser console.
I was able to solve the issue by adding the cors package and using it as a middleware for express (just adding app.use(cors()); to index.js).
It seems like this would be a fairly common use case and I was surprised that this isn't set up out-of-the box. Is this something that should be added? If so, I'd be happy to submit a PR.
Thanks!
The text was updated successfully, but these errors were encountered:
When I try to use XMLHttpRequest to POST data to
/api/events
, I get an error related to CORS in the browser console.I was able to solve the issue by adding the cors package and using it as a middleware for express (just adding
app.use(cors());
to index.js).It seems like this would be a fairly common use case and I was surprised that this isn't set up out-of-the box. Is this something that should be added? If so, I'd be happy to submit a PR.
Thanks!
The text was updated successfully, but these errors were encountered: