diff --git a/ElevenLabs-DotNet-Proxy/ElevenLabs-DotNet-Proxy.csproj b/ElevenLabs-DotNet-Proxy/ElevenLabs-DotNet-Proxy.csproj index 5d2c963..8265666 100644 --- a/ElevenLabs-DotNet-Proxy/ElevenLabs-DotNet-Proxy.csproj +++ b/ElevenLabs-DotNet-Proxy/ElevenLabs-DotNet-Proxy.csproj @@ -15,9 +15,11 @@ ElevenLabs, AI, ML, API, api-proxy, proxy, gateway ElevenLabs API Proxy ElevenLabs-DotNet-Proxy - 2.2.1 + 2.2.2 ElevenLabs.Proxy - Version 2.2.1 + Version 2.2.2 +- Updated EndpointRouteBuilder with optional route prefix parameter +Version 2.2.1 - Refactor with modern WebApplication builder - Added ElevenLabs.Proxy.EndpointRouteBuilder diff --git a/ElevenLabs-DotNet-Proxy/Proxy/ElevenLabsProxyStartup.cs b/ElevenLabs-DotNet-Proxy/Proxy/ElevenLabsProxyStartup.cs index 0b2a68e..e8fab3f 100644 --- a/ElevenLabs-DotNet-Proxy/Proxy/ElevenLabsProxyStartup.cs +++ b/ElevenLabs-DotNet-Proxy/Proxy/ElevenLabsProxyStartup.cs @@ -73,7 +73,7 @@ public static IHost CreateDefaultHost(string[] args, ElevenLabsClient elevenL /// /// type to use to validate your custom issued tokens. /// Startup args. - /// with configured and . + /// with configured and . public static WebApplication CreateWebApplication(string[] args, ElevenLabsClient elevenLabsClient) where T : class, IAuthenticationFilter { var builder = WebApplication.CreateBuilder(args); diff --git a/ElevenLabs-DotNet-Proxy/Proxy/EndpointRouteBuilder.cs b/ElevenLabs-DotNet-Proxy/Proxy/EndpointRouteBuilder.cs index 181f68d..c3ebfbd 100644 --- a/ElevenLabs-DotNet-Proxy/Proxy/EndpointRouteBuilder.cs +++ b/ElevenLabs-DotNet-Proxy/Proxy/EndpointRouteBuilder.cs @@ -42,10 +42,16 @@ public static class EndpointRouteBuilder #endif }; - public static void MapElevenLabsEndpoints(this IEndpointRouteBuilder endpoints, - ElevenLabsClient elevenLabsClient, IAuthenticationFilter authenticationFilter) + /// + /// Maps the endpoints. + /// + /// . + /// . + /// . + /// Optional, custom route prefix. i.e. '/elevenlabs'. + public static void MapElevenLabsEndpoints(this IEndpointRouteBuilder endpoints, ElevenLabsClient elevenLabsClient, IAuthenticationFilter authenticationFilter, string routePrefix = "") { - endpoints.Map($"{elevenLabsClient.ElevenLabsClientSettings.BaseRequest}{{**endpoint}}", HandleRequest); + endpoints.Map($"{routePrefix}{elevenLabsClient.ElevenLabsClientSettings.BaseRequest}{{**endpoint}}", HandleRequest); async Task HandleRequest(HttpContext httpContext, string endpoint) {