2023-08-12 20:13:47 +01:00
|
|
|
namespace OliverBooth.Blog.Middleware;
|
2023-08-09 21:08:57 +01:00
|
|
|
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
}
|