Implemented theme crud and basic theme loading

This commit is contained in:
2026-01-18 23:31:01 +01:00
parent 56b14f60f1
commit 3cbdd3b203
27 changed files with 1218 additions and 14 deletions

View File

@@ -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");
}
}