front-end: react, back-end: node, when the project work on local its work good but when Ι use ngrok and swap the local-url-api by ngrok api-url i see this problem:
Access to XMLHttpRequest at 'API-URL' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. POST "API-URL" net::ERR_FAILED
in node js Ι use cors
app.use(cors({
origin: "*" ,
credentials: true,
optionSuccessStatus: 200
}));