79369161

Date: 2025-01-19 15:03:40
Score: 1.5
Natty:
Report link
    If any CORS policy is injected into your backend project, you can put your frontend URL in this configuration. We have shared an example of how to add CORS to our project. I hope this solution is okay. If not, please let us know.

builder.Services.AddCors(options =>
{
    options.AddPolicy(name: MyAllowSpecificOrigins,
                      builder =>
                      {
                          builder.WithOrigins("http://localhost:5173"); // You can add value in configuration file
                      });
});
Reasons:
  • Whitelisted phrase (-1): solution is
  • RegEx Blacklisted phrase (2.5): please let us know
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Dattatray Patil