Started refactoring to be compatible with the changed nuget packages and the mooncore changes
This commit is contained in:
10
MoonlightServers.ApiServer.Runtime/DevPluginLoader.cs
Normal file
10
MoonlightServers.ApiServer.Runtime/DevPluginLoader.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using MoonCore.PluginFramework;
|
||||
using Moonlight.ApiServer.Plugins;
|
||||
|
||||
namespace MoonlightServers.ApiServer.Runtime;
|
||||
|
||||
[PluginLoader]
|
||||
public partial class DevPluginLoader : IPluginStartup
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<NoDefaultLaunchSettingsFile>True</NoDefaultLaunchSettingsFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MoonlightServers.ApiServer\MoonlightServers.ApiServer.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.7" />
|
||||
<PackageReference Include="MoonCore.PluginFramework" Version="1.0.8"/>
|
||||
<PackageReference Include="MoonCore.PluginFramework.Generator" Version="1.0.2"/>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.7" PrivateAssets="all"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
31
MoonlightServers.ApiServer.Runtime/Program.cs
Normal file
31
MoonlightServers.ApiServer.Runtime/Program.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Moonlight.ApiServer.Startup;
|
||||
using MoonlightServers.ApiServer.Runtime;
|
||||
|
||||
var pluginLoader = new DevPluginLoader();
|
||||
pluginLoader.Initialize();
|
||||
|
||||
var cs = new Startup();
|
||||
|
||||
await cs.Initialize(args, pluginLoader.Instances);
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
await cs.AddMoonlight(builder);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
await cs.AddMoonlight(app);
|
||||
|
||||
// Handle setup of wasm app hosting in the runtime
|
||||
// so the Moonlight.ApiServer doesn't need the wasm package
|
||||
if (cs.Configuration.Frontend.EnableHosting)
|
||||
{
|
||||
if (app.Environment.IsDevelopment())
|
||||
app.UseWebAssemblyDebugging();
|
||||
|
||||
app.UseBlazorFrameworkFiles();
|
||||
app.UseStaticFiles();
|
||||
}
|
||||
|
||||
|
||||
await app.RunAsync();
|
||||
Reference in New Issue
Block a user