feat(AuthApiParams): Konfiguriert über IOptions.

This commit is contained in:
Developer 02 2025-01-15 09:42:40 +01:00
parent 6553104f8d
commit 34b939f75a

View File

@ -1,10 +1,15 @@
using DigitalData.Auth.API.Config;
var builder = WebApplication.CreateBuilder(args);
var config = builder.Configuration;
builder.Configuration.AddJsonFile("consumers.json", true, true);
var apiParams = config.Get<AuthApiParams>() ?? throw new InvalidOperationException("AuthApiOptions is missing or invalid in appsettings.");
// Add services to the container.
builder.Services.Configure<AuthApiParams>(config);
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
@ -26,4 +31,4 @@ app.UseAuthorization();
app.MapControllers();
app.Run();
app.Run();