oliverbooth.dev/OliverBooth/Middleware/RssEndpointExtensions.cs

14 lines
421 B
C#
Raw Normal View History

2023-08-11 15:51:20 +01:00
namespace OliverBooth.Middleware;
internal static class RssEndpointExtensions
{
public static IEndpointConventionBuilder MapRssFeed(this IEndpointRouteBuilder endpoints, string pattern)
{
RequestDelegate pipeline = endpoints.CreateApplicationBuilder()
.UseMiddleware<RssMiddleware>()
.Build();
return endpoints.Map(pattern, pipeline).WithDisplayName("RSS Feed");
}
}