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
I've been stuck at cors issue with reconnecting event source.
All my others API's are working fine but when I use ReconnectingEventSource I start facing Cors error.
if work with templates in django, it works very well without any error. but I want to use react at my frontend side. please let me know how to fix this error. I'm stuck at it very badly.
The text was updated successfully, but these errors were encountered:
In your frontend can you try this and see if it works.
function App() {
useEffect(() => {
let es = new ReconnectingEventSource("http://localhost:8000/events/", { withCredentials: true })
es.onopen = function (){
console.log("connected")
}
},[])
}
Hello,
I've been stuck at cors issue with reconnecting event source.
All my others API's are working fine but when I use ReconnectingEventSource I start facing Cors error.
my code at frontend with react
backend code
settings.py
asgi.py
if work with templates in django, it works very well without any error. but I want to use react at my frontend side. please let me know how to fix this error. I'm stuck at it very badly.
The text was updated successfully, but these errors were encountered: