D20Tek.MinimalApi.DevView
1.0.1
See the version list below for details.
dotnet add package D20Tek.MinimalApi.DevView --version 1.0.1
NuGet\Install-Package D20Tek.MinimalApi.DevView -Version 1.0.1
<PackageReference Include="D20Tek.MinimalApi.DevView" Version="1.0.1" />
<PackageVersion Include="D20Tek.MinimalApi.DevView" Version="1.0.1" />
<PackageReference Include="D20Tek.MinimalApi.DevView" />
paket add D20Tek.MinimalApi.DevView --version 1.0.1
#r "nuget: D20Tek.MinimalApi.DevView, 1.0.1"
#:package D20Tek.MinimalApi.DevView@1.0.1
#addin nuget:?package=D20Tek.MinimalApi.DevView&version=1.0.1
#tool nuget:?package=D20Tek.MinimalApi.DevView&version=1.0.1
MinimalApi-DevView
Introduction
MinimalApi.DevView is a lightweight, zero-config diagnostic toolkit for .NET Minimal API projects. Designed for development-time use, it provides runtime insights into your app’s metadata, routes, and requests — all accessible via a simple /dev endpoint. It's like a plug-and-play developer control panel for Minimal APIs.
Features
/dev/info– App metadata: environment, version, uptime, etc./dev/routes– Lists all mapped endpoints and their handlers- Request/response logging – Method, path, status code, and duration
- Auto-disabled in production
- Fully configurable base path and options in your MinimalApi app.config file
Installation
Install via NuGet:
PM > Install-Package D20Tek.MinimalApi.DevView
To install in the Visual Studio UI, go to the Tools menu > "Manage NuGet Packages". Then search for D20Tek.MinimalApi.DevView, and install whichever package version you require from there.
Usage
In your Program.cs, enable MinimalApi.DevView only in development:
using D20Tek.MinimalApi.DevView;
...
builder.Services.AddDevView(builder.Configuration);
...
if (app.Environment.IsDevelopment())
{
app.UseDevView();
}
This automatically:
- Maps /dev/info and /dev/routes
- Adds middleware for request/response logging
- Reads configuration from DI and environment
- Will not leak internal diagnostics in production or staging environments unless explicitly configured
You can override the default settings via appsettings.Development.json in your MinimalApi project:
{
"DevView": {
"BasePath": "/my-dev",
"LogLevel": "Information"
}
}
Endpoints
With DevView added, your MinimalApi project will now have two additional routes when you run the service. These routes are available to help you understand your service Api.
/dev/info - returns app metadata:
{
"AppName": "MyApi",
"Environment": "Development",
"Version": "1.0.0",
"StartTime": "2025-05-20T12:34:56Z",
"UptimeSeconds": 132
}
/dev/routes - lists all mapped Minimal API endpoints:
[
{
"Method": "GET",
"Pattern": "/users/{id}",
"Handler": "UserEndpoints.GetById",
"Produces": [ "application/json" ]
},
{
"Method": "POST",
"Pattern": "/auth/login",
"Handler": "AuthEndpoints.Login"
}
]
Logging
By default, DevView registers a request/response logger to help with debugging your service. The logging output looks like this:
--> GET /users/5
<-- 200 OK (112ms)
Feedback
If you use this library and have any feedback, bugs, or suggestions, please file them in the Issues section of this repository. I'm still in the process of building the library and samples, so any suggestions that would make it more useable are welcome.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.5)
- Microsoft.Extensions.Options (>= 9.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.