LANCommander/LANCommander.Server/Startup/Endpoints.cs
Pat Hartl f87756243e Add support for defining PowerShell modules
Adds a new section "Scripting" in the server UI where PowerShell modules can be defined. These can be used for defining a library of functions that can be used in any script. These modules are automatically synced to the launcher and imported upon script execution.
2026-06-28 23:02:35 -05:00

51 lines
No EOL
1.8 KiB
C#

using LANCommander.Server.Endpoints;
namespace LANCommander.Server.Startup;
public static class Endpoints
{
public static void AddControllers(this WebApplicationBuilder builder)
{
builder.Services.AddControllers().AddJsonOptions(static x =>
{
x.JsonSerializerOptions.ReferenceHandler = System.Text.Json.Serialization.ReferenceHandler.IgnoreCycles;
});
}
public static WebApplication MapEndpoints(this WebApplication app)
{
app.UseEndpoints(endpoints =>
{
endpoints.MapAuthenticationEndpoints();
endpoints.MapAuthApiEndpoints();
endpoints.MapChatEndpoints();
endpoints.MapDownloadEndpoints();
endpoints.MapExportEndpoints();
endpoints.MapGameEndpoints();
endpoints.MapDepotEndpoints();
endpoints.MapArchivesEndpoints();
endpoints.MapUploadEndpoints();
endpoints.MapProfileEndpoints();
endpoints.MapPlaySessionsEndpoints();
endpoints.MapMediaEndpoints();
endpoints.MapKeysEndpoints();
endpoints.MapLauncherEndpoints();
endpoints.MapLibraryEndpoints();
endpoints.MapRedistributablesEndpoints();
endpoints.MapModulesEndpoints();
endpoints.MapToolsEndpoints();
endpoints.MapIssueEndpoints();
endpoints.MapSaveEndpoints();
endpoints.MapServerEndpoints();
endpoints.MapSettingsEndpoints();
endpoints.MapLogEndpoints();
endpoints.MapHqEndpoints();
endpoints.MapMetadataEndpoints();
endpoints.MapTagEndpoints();
endpoints.MapControllers();
endpoints.MapFallbackToPage("/_Host");
});
return app;
}
}