Skip to content

Instantly share code, notes, and snippets.

@shoebsd31
Created March 4, 2024 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shoebsd31/9eb942666d7e1591f492c25e6a244a23 to your computer and use it in GitHub Desktop.
Save shoebsd31/9eb942666d7e1591f492c25e6a244a23 to your computer and use it in GitHub Desktop.
CORS configuration for C#
builder.Services.AddCors(options =>
{
options.AddPolicy(name: "yourFrontend",
policy =>
{
policy.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials()
.WithOrigins("http://localhost:7072");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment