Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.18 KB

README.md

File metadata and controls

33 lines (24 loc) · 1.18 KB

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