mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 21:24:54 +00:00
feat: add methods to add routes to API
This commit is contained in:
@@ -67,8 +67,6 @@ namespace PepperDash.Essentials.Core.Web
|
|||||||
_server = new WebApiServer(Key, Name, BasePath);
|
_server = new WebApiServer(Key, Name, BasePath);
|
||||||
|
|
||||||
SetupRoutes();
|
SetupRoutes();
|
||||||
|
|
||||||
Initialize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetupRoutes()
|
private void SetupRoutes()
|
||||||
@@ -175,6 +173,27 @@ namespace PepperDash.Essentials.Core.Web
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a single route to the API. MUST be done during the activation phase
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="route"></param>
|
||||||
|
public void AddRoute(HttpCwsRoute route)
|
||||||
|
{
|
||||||
|
_server.AddRoute(route);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a collection of routes to the API. MUST be done during the activation phase
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="routes"></param>
|
||||||
|
public void AddRoute(List<HttpCwsRoute> routes)
|
||||||
|
{
|
||||||
|
foreach (var route in routes)
|
||||||
|
{
|
||||||
|
AddRoute(route);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes the CWS class
|
/// Initializes the CWS class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user