2025-12-23 21:12:06 -06:00
|
|
|
using LANCommander.SDK.Abstractions;
|
2025-10-05 21:31:16 -05:00
|
|
|
using LANCommander.SDK.Extensions;
|
2026-07-23 19:47:22 -05:00
|
|
|
using LANCommander.SDK.Plugins;
|
2025-12-23 21:12:06 -06:00
|
|
|
using LANCommander.SDK.Services;
|
|
|
|
|
using LANCommander.Server.Clients;
|
2025-07-27 17:51:50 -05:00
|
|
|
using LANCommander.Server.ImportExport.Extensions;
|
2025-03-15 21:00:00 -05:00
|
|
|
using LANCommander.Server.Providers;
|
2025-03-16 14:35:53 -05:00
|
|
|
using LANCommander.Server.Services.Abstractions;
|
2025-03-15 21:00:00 -05:00
|
|
|
using LANCommander.Server.Services.Extensions;
|
2025-12-23 21:12:06 -06:00
|
|
|
using LANCommander.Server.Services.Providers;
|
2025-03-17 02:02:17 -05:00
|
|
|
using LANCommander.UI.Extensions;
|
2025-03-11 21:21:16 -05:00
|
|
|
|
|
|
|
|
namespace LANCommander.Server.Startup;
|
|
|
|
|
|
|
|
|
|
public static class Services
|
|
|
|
|
{
|
2025-11-16 12:31:25 -06:00
|
|
|
public static WebApplicationBuilder AddLANCommanderServices(this WebApplicationBuilder builder)
|
2025-03-11 21:21:16 -05:00
|
|
|
{
|
2025-12-23 21:12:06 -06:00
|
|
|
builder.Services.AddSingleton<IServerAddressProvider, ServerAddressProvider>();
|
|
|
|
|
builder.Services.AddSingleton<IVersionProvider, VersionProvider>();
|
|
|
|
|
builder.Services.AddScoped<IChatClient, ServerChatClient>();
|
2026-06-28 14:09:02 -05:00
|
|
|
builder.Services.AddScoped<LANCommander.Server.Endpoints.DownloadThrottle>();
|
2025-12-23 21:12:06 -06:00
|
|
|
|
2025-11-19 19:52:36 -06:00
|
|
|
builder.Services.AddLANCommanderClient<Settings.Settings>();
|
2025-11-16 12:31:25 -06:00
|
|
|
builder.Services.AddLANCommanderServer();
|
2025-07-27 17:51:50 -05:00
|
|
|
builder.Services.AddLANCommanderImportExport();
|
2025-03-17 02:02:17 -05:00
|
|
|
builder.Services.AddLANCommanderUI();
|
2025-03-11 21:21:16 -05:00
|
|
|
|
|
|
|
|
builder.Services.AddAntDesign();
|
|
|
|
|
builder.Services.AddHttpClient();
|
|
|
|
|
builder.Services.AddHttpContextAccessor();
|
2025-08-06 19:37:11 -05:00
|
|
|
builder.AddServiceDefaults();
|
2025-03-11 21:21:16 -05:00
|
|
|
|
2026-07-23 19:47:22 -05:00
|
|
|
// Plugin framework: discover drop-in plugins and let them register services. Must run last,
|
|
|
|
|
// while the service collection is still open (the provider is built immediately after).
|
|
|
|
|
PluginBootstrap.ConfigurePlugins(builder.Services, PluginHost.Server);
|
|
|
|
|
|
2025-03-11 21:21:16 -05:00
|
|
|
return builder;
|
|
|
|
|
}
|
|
|
|
|
}
|