aboutsummaryrefslogtreecommitdiff
path: root/plugins/VNLib.Plugins.Essentials.Content.Routing/src
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-01-02 02:33:18 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2024-01-02 02:33:18 -0500
commite86fa273f2093089bec6379b6fa6b48625588a40 (patch)
treedb03cbc9d402277f37350062c3a50f75affd0913 /plugins/VNLib.Plugins.Essentials.Content.Routing/src
parent0ca26fc63cc5311298575209b124516139f58206 (diff)
breaking changes: plugin service pools & move plugin api away from web related
Diffstat (limited to 'plugins/VNLib.Plugins.Essentials.Content.Routing/src')
-rw-r--r--plugins/VNLib.Plugins.Essentials.Content.Routing/src/PageRouterEntry.cs20
1 files changed, 6 insertions, 14 deletions
diff --git a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/PageRouterEntry.cs b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/PageRouterEntry.cs
index 8370806..da254e2 100644
--- a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/PageRouterEntry.cs
+++ b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/PageRouterEntry.cs
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2023 Vaughn Nugent
+* Copyright (c) 2024 Vaughn Nugent
*
* Library: VNLib
* Package: VNLib.Plugins.Essentials.Content.Routing
@@ -23,10 +23,8 @@
*/
using System;
-using System.ComponentModel.Design;
using VNLib.Utils.Logging;
-using VNLib.Plugins.Attributes;
using VNLib.Plugins.Extensions.Loading;
namespace VNLib.Plugins.Essentials.Content.Routing
@@ -35,19 +33,13 @@ namespace VNLib.Plugins.Essentials.Content.Routing
{
public override string PluginName => "Essentials.Router";
- private Router PageRouter;
-
- [ServiceConfigurator]
- public void ConfigureServices(IServiceContainer services)
- {
- //Deploy the page router to the host
- services.AddService<IPageRouter>(PageRouter);
- }
+ private Router Router;
protected override void OnLoad()
{
- //Init router
- PageRouter = this.GetOrCreateSingleton<Router>();
+ //Init router and export it as a service
+ Router = this.GetOrCreateSingleton<Router>();
+ this.ExportService<IPageRouter>(Router);
Log.Information("Plugin loaded");
}
@@ -61,7 +53,7 @@ namespace VNLib.Plugins.Essentials.Content.Routing
{
if(cmd.Contains("reset", StringComparison.OrdinalIgnoreCase))
{
- PageRouter?.ResetRoutes();
+ Router?.ResetRoutes();
Log.Information("Routing table reset");
}
}