mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
561 B
21 lines
561 B
using System.Reflection; |
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
namespace ErsatzTV.Controllers.Api; |
|
|
|
[ApiController] |
|
[EndpointGroupName("general")] |
|
public class VersionController |
|
{ |
|
private static readonly string Version; |
|
|
|
static VersionController() => |
|
Version = Assembly.GetEntryAssembly()? |
|
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()? |
|
.InformationalVersion ?? "unknown"; |
|
|
|
[HttpGet("/api/version")] |
|
[Tags("Version")] |
|
[EndpointSummary("Get version")] |
|
public string GetVersion() => Version; |
|
}
|
|
|