Switched to postgresql. Documented startup. Updated dbcontext register call. Added virtual plugin manifest loading

This commit is contained in:
2025-02-26 22:39:48 +01:00
parent a8d867c3c7
commit 8f1cc29b8d
20 changed files with 555 additions and 2437 deletions

View File

@@ -1,7 +1,35 @@
using System.Text.Json;
using Moonlight.ApiServer;
using Moonlight.ApiServer.Models;
// Development Server Startup
// This file is a small helper for development instances for moonlight.
// It calls the moonlight startup with the current project loaded as a plugin.
// This allows you to develop and debug projects without any hassle
// !!! DO NOT HARDCORE ANY SECRETS HERE !!!
var startup = new Startup();
await startup.Run(args, [
typeof(Program).Assembly
]);
#region Creating virtual plugin manifest from plugin.json file
// Read out content
var pluginManifestJson = await File.ReadAllTextAsync("../plugin.json");
// Parse to model
var pluginManifest = JsonSerializer.Deserialize<PluginManifest>(pluginManifestJson, new JsonSerializerOptions()
{
PropertyNameCaseInsensitive = true
})!;
// Clear assemblies as we are loading them using the additional assembly parameter
pluginManifest.Assemblies.Clear();
#endregion
await startup.Run(
args,
[typeof(Program).Assembly],
[pluginManifest]
);