I have tried fixing it with cors but it just doesn’t work . I have also used the full url of backend and frontend that is exposed publicly . The exact error that I am getting is by cors saying the preflight was redirected and that is not allowed . I am guessing the idx is intercepting the request and that is causing the problem . I don’t know how to fix this. please help me here , I face these problems regularly working on this platform .
thankyou .
the configuration and code →
cors →
app.use(cors({
origin:["http://localhost:5173",FRONTEND_URL],
methods:["GET","POST","DELETE","PUT","OPTIONS"],
credentials:true,
allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With', 'device-remember-token', 'Access-Control-Allow-Origin', 'Origin', 'Accept']
}));
the FRONTEND_URL contains full public exposed url with https://5173…dev/
I would be really grateful if you could provide me a solution here