feat(AuthApiParams): Konfiguriert über IOptions.
This commit is contained in:
parent
6553104f8d
commit
34b939f75a
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user