This commit is contained in:
Simple_Not 2022-10-20 11:17:03 +10:00
parent c661201812
commit 806c0eaf76

View File

@ -5,6 +5,16 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers(); builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer(); builder.Services.AddEndpointsApiExplorer();
builder.Services.AddCors(setup =>
{
setup.AddDefaultPolicy(policyBuilder =>
{
policyBuilder.WithOrigins("http://www.vdk2ch.ru:4200");
});
});
//builder.Services.AddSwaggerGen(); //builder.Services.AddSwaggerGen();
var app = builder.Build(); var app = builder.Build();
@ -18,6 +28,8 @@ if (app.Environment.IsDevelopment())
//app.UseHttpsRedirection(); //app.UseHttpsRedirection();
app.UseCors();
app.UseAuthorization(); app.UseAuthorization();
app.MapControllers(); app.MapControllers();