Skip to content

Instantly share code, notes, and snippets.

@babaktaremi
Created August 22, 2021 14:01
Show Gist options
  • Save babaktaremi/e4e0433b1dc8a7ffcbd010b0761665f9 to your computer and use it in GitHub Desktop.
Save babaktaremi/e4e0433b1dc8a7ffcbd010b0761665f9 to your computer and use it in GitHub Desktop.
services.AddCors(options =>
{
options.AddPolicy("ApiCorsPolicy",
builder => builder
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials()
.WithOrigins("http://localhost:5200")
.SetPreflightMaxAge(TimeSpan.FromHours(1)));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment