using HackerNet.Infrastructure.AspNet; using HackerNet.Infrastructure.Repositories.EntityFramework; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection.Extensions; var builder = WebApplication.CreateBuilder(args); builder.Services.AddHackerNetServicesEntityFramework(builder.Configuration); builder.Services.AddControllers(); builder.Services .AddIdentityCore() .AddRoles() .AddSignInManager() .AddEntityFrameworkStores(); builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(); builder.Services.AddOpenApiDocument(d => { d.Title = "HackerNet API"; }); var app = builder.Build(); app.MigrateDatabase(); app.UseOpenApi(); app.UseSwaggerUi3(); app.UseAuthentication(); app.UseAuthorization(); app.MapGet("/", () => "Hello World!"); app.MapControllers(); app.Run();