Compare commits

...

2 Commits

Author SHA1 Message Date
Simple_Not
63330d5fc0 Merge branch 'master' of http://git.vdk2ch.ru:3000/RakVhalate/2chBackAPI into master
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-20 11:17:13 +10:00
Simple_Not
806c0eaf76 cors 2022-10-20 11:17:03 +10:00

View File

@ -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();