Hello. When I upload NestJS server in production. I get CORS error.
Can I enable cors even when I am having two different domains (for client and server)
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
cors: true,
});
app.enableCors({
origin: 'https://mysite.vercel.app',
credentials: true,
});
Access to fetch at 'https://api.mysite.net/' from origin 'https://mysite.vercel.app' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.