Files
vegasco/src/Vegasco.Server.Api/Info/GetServerInfo.cs
ThompsonNye a1999bfe41
All checks were successful
continuous-integration/drone/push Build is passing
Rename WebApi project to Vegasco.Server.Api
And update all references including comments etc.
2025-06-12 18:23:09 +02:00

29 lines
761 B
C#

using Microsoft.AspNetCore.Http.HttpResults;
namespace Vegasco.Server.Api.Info;
public class GetServerInfo
{
public record Response(
string FullVersion,
string CommitId,
DateTime CommitDate,
string Environment);
public static RouteHandlerBuilder MapEndpoint(IEndpointRouteBuilder builder)
{
return builder
.MapGet("info/server", Endpoint)
.WithTags("Info");
}
private static Ok<Response> Endpoint(
IHostEnvironment environment)
{
return TypedResults.Ok(new Response(
ThisAssembly.AssemblyInformationalVersion,
ThisAssembly.GitCommitId,
ThisAssembly.GitCommitDate,
environment.EnvironmentName));
}
}