Zupit.VersionEndpoint adds an API endpoint returing the app assembly version.
License
—
Deps
0
Install Size
—
Vulns
✓ 0
Published
Feb 19, 2024
$ dotnet add package Zupit.VersionEndpointThis library adds a version endpoint to your ASP.NET Core application. The version is based on the assembly version of the application. You can customize it as you like.
The endpoint is accessible via GET /version and returns a string with the version. You can customize the endpoint path.
dotnet add package Zupit.VersionEndpoint
In your Program.cs file, add the following code:
using Zupit.VersionEndpoint;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
...
// Add the version endpoint
app.MapVersionEndpoint();
// or
app.MapVersionEndpoint("/custom-path");