Hey,
I'm currently deploy Flask app (Deployed as Serverless). I'm also having a React Vercel App.
At my Flask app, I have custom env (staging) with vercel domain, which Im using the bypass token for the frontend to interact with him.
I keep getting CORs Issue at my frontend (from chrome). I tried add flask-cors at the code itself, or alternative adding to vercel.json the following:
{ "rewrites": [ { "source": "/api/(.*)", "destination": "/api/index" } ], "headers": [ { "source": "/api/(.*)", "headers": [ { "key": "Access-Control-Allow-Origin", "value": "*" }, { "key": "Access-Control-Allow-Credentials", "value": "true" }, { "key": "Access-Control-Allow-Headers", "value": "*" }, { "key": "Access-Control-Allow-Methods", "value": "GET,OPTIONS,PATCH,DELETE,POST,PUT" } ] } ]}
both are not working.
Im also getting 401 at the preflight request when trying do OPTIONS request to the backend.
At postman everything is working. Am I missing something? Thanks!