En el proyecto api se modifica el appsettings para añadir la nueva cadena de conexion y la seccion JwtSettings
45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
using CleanArchitecture.Application;
|
|
using CleanArchitecture.Infrastructure;
|
|
using CleanArchitecture.Identity;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
|
|
builder.Services.AddControllers();
|
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
|
|
builder.Services.AddInfrastructureServices(builder.Configuration);
|
|
builder.Services.AddApplicationServices();
|
|
builder.Services.ConfigureIdentityServices(builder.Configuration);
|
|
|
|
builder.Services.AddCors(o =>
|
|
{
|
|
o.AddPolicy("CorsPolicy", builder =>
|
|
builder.AllowAnyOrigin().
|
|
AllowAnyMethod().
|
|
AllowAnyHeader());
|
|
});
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
}
|
|
|
|
app.UseAuthentication();
|
|
app.UseAuthorization();
|
|
|
|
app.UseCors("CorsPolicy");
|
|
|
|
app.MapControllers();
|
|
|
|
app.Run();
|