using BlogPlatform;
using FastEndpoints;
using FastEndpoints.Security;
using FastEndpoints.Swagger;

var builder = WebApplication.CreateBuilder(args);

// Services (avant Build)
builder.Services.AddDbContext<BlogPlatformDbContext>(); 
builder.Services.AddFastEndpoints().SwaggerDocument(); 
builder.Services.AddAuthenticationJwtBearer(s => s.SigningKey = "THCAUZUUZUZFUFDHFSJQIDJIQJDIQJSIQJZ");//add this
builder.Services.AddAuthorization();

  
var app = builder.Build();

// Pipeline (après Build)
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
app.UseFastEndpoints();
app.UseSwaggerGen();

app.Run();
