forked from sanchezvem/PyroFetes
Ajout de Login et du model réuni avec tout les autres Sujet
This commit is contained in:
@@ -2,18 +2,27 @@ using API;
|
||||
using FastEndpoints;
|
||||
using FastEndpoints.Swagger;
|
||||
using PyroFetes;
|
||||
using FastEndpoints.Security;
|
||||
|
||||
|
||||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// On ajoute ici FastEndpoints, un framework REPR et Swagger aux services disponibles dans le projet
|
||||
builder.Services.AddFastEndpoints().SwaggerDocument();
|
||||
builder.Services
|
||||
.AddAuthenticationJwtBearer(s => s.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong")
|
||||
.AddAuthorization()
|
||||
.AddFastEndpoints()
|
||||
.SwaggerDocument();
|
||||
|
||||
// On ajoute ici la configuration de la base de données
|
||||
builder.Services.AddDbContext<PyroFetesDbContext>();
|
||||
|
||||
// On construit l'application en lui donnant vie
|
||||
WebApplication app = builder.Build();
|
||||
app.UseFastEndpoints().UseSwaggerGen();
|
||||
app.UseAuthentication()
|
||||
.UseAuthorization()
|
||||
.UseFastEndpoints()
|
||||
.UseSwaggerGen();
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
|
Reference in New Issue
Block a user