NikiforovAll / ConfigurationDebugViewEndpoint

Add endpoint-enabled middleware by using IEndpointRouteBuilder extension method. https://nikiforovall.github.io/dotnet/aspnetcore/2021/03/23/endpoint-route-builder-extension-pattern.html

Home Page:https://www.nuget.org/packages/ConfigurationDebugViewEndpoint/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NikiforovAll.ConfigurationDebugViewEndpoint

GitHub Actions Status

GitHub Actions Build History

A convenient extension method(s) for IEndpointRouteBuilder to add configuration debug view.

The goal of this project is to provide a convenient way of adding something like this to a project:

Before:

app.UseEndpoints(endpoints =>
{
    endpoints.MapGet("/config", async context =>
    {
        var config = (Configuration as IConfigurationRoot).GetDebugView();
        await context.Response.WriteAsync(config);
    });
});

After:

app.UseEndpoints(endpoints =>
{
    endpoints.MapConfigurationDebugView("/config", (options) => options.AllowDevelopmentOnly = true);
});

For more examples, please see: tests

About

Add endpoint-enabled middleware by using IEndpointRouteBuilder extension method. https://nikiforovall.github.io/dotnet/aspnetcore/2021/03/23/endpoint-route-builder-extension-pattern.html

https://www.nuget.org/packages/ConfigurationDebugViewEndpoint/

License:MIT License


Languages

Language:C# 100.0%