shopping-assistant-api/ShoppingAssistantApi.Api/ApiExtentions/CorsExtension.cs
2023-12-02 20:54:49 +00:00

22 lines
512 B
C#

namespace ShoppingAssistantApi.Api.ApiExtentions;
public static class CorsExtension
{
public static IServiceCollection AddCorsAllowAny(this IServiceCollection services)
{
services.AddCors(options =>
{
options.AddPolicy("allowAnyOrigin",
builder =>
{
builder
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader();
});
});
return services;
}
}