Implemented theme crud and basic theme loading
This commit is contained in:
@@ -2,11 +2,14 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.Console;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Moonlight.Api.Configuration;
|
||||
using Moonlight.Shared.Http;
|
||||
using Moonlight.Api.Helpers;
|
||||
using Moonlight.Api.Implementations;
|
||||
using Moonlight.Api.Interfaces;
|
||||
using Moonlight.Api.Services;
|
||||
using SessionOptions = Microsoft.AspNetCore.Builder.SessionOptions;
|
||||
|
||||
namespace Moonlight.Api.Startup;
|
||||
|
||||
@@ -32,6 +35,9 @@ public partial class Startup
|
||||
|
||||
builder.Services.AddMemoryCache();
|
||||
builder.Services.AddOptions<SessionOptions>().BindConfiguration("Moonlight:Session");
|
||||
|
||||
builder.Services.AddOptions<FrontendOptions>().BindConfiguration("Moonlight:Frontend");
|
||||
builder.Services.AddScoped<FrontendService>();
|
||||
}
|
||||
|
||||
private static void UseBase(WebApplication application)
|
||||
@@ -43,6 +49,9 @@ public partial class Startup
|
||||
{
|
||||
application.MapControllers();
|
||||
|
||||
application.MapFallbackToFile("index.html");
|
||||
var options = application.Services.GetRequiredService<IOptions<FrontendOptions>>();
|
||||
|
||||
if(options.Value.Enabled)
|
||||
application.MapFallbackToFile("index.html");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user