cors
This commit is contained in:
parent
c661201812
commit
806c0eaf76
12
Program.cs
12
Program.cs
@ -5,6 +5,16 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
|
||||
|
||||
builder.Services.AddCors(setup =>
|
||||
{
|
||||
setup.AddDefaultPolicy(policyBuilder =>
|
||||
{
|
||||
policyBuilder.WithOrigins("http://www.vdk2ch.ru:4200");
|
||||
});
|
||||
|
||||
});
|
||||
//builder.Services.AddSwaggerGen();
|
||||
|
||||
var app = builder.Build();
|
||||
@ -18,6 +28,8 @@ if (app.Environment.IsDevelopment())
|
||||
|
||||
//app.UseHttpsRedirection();
|
||||
|
||||
app.UseCors();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
Reference in New Issue
Block a user