Load proper config file for non-Docker API

This commit is contained in:
Ske 2020-04-16 22:03:23 +02:00
parent 4fe40b220e
commit ab8382dffe

View File

@ -1,4 +1,6 @@
using Autofac; using System;
using Autofac;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
@ -31,7 +33,7 @@ namespace PluralKit.API
public void ConfigureContainer(ContainerBuilder builder) public void ConfigureContainer(ContainerBuilder builder)
{ {
builder.RegisterInstance(Configuration); builder.RegisterInstance(InitUtils.BuildConfiguration(Environment.GetCommandLineArgs()).Build()).As<IConfiguration>();
builder.RegisterModule(new ConfigModule<object>()); builder.RegisterModule(new ConfigModule<object>());
builder.RegisterModule(new LoggingModule("api")); builder.RegisterModule(new LoggingModule("api"));
builder.RegisterModule(new MetricsModule("API")); builder.RegisterModule(new MetricsModule("API"));