Back to Practical Aspnetcore

WebApplication - list all the configuration information available as JSON

projects/minimal-hosting/web-application-configuration-json/README.md

latest762 B
Original Source

WebApplication - list all the configuration information available as JSON

This sample uses the brand new WebApplication hosting class.

In this example we list all the information available in the app.Configuration property and return it as JSON.

WARNING

Exposing your sensitive configuration information over the wire like this is a terrible idea. Do not do this in your application. This sample is just meant to demonstrate a technique.

You can read the implementation of WebApplication here and its sibling WebApplicationBuilder here