Add version 1.0.5 and /api/version endpoint

- Added Version, AssemblyVersion, and FileVersion to project file
- Added /api/version endpoint returning version info
- Follows SilverPay versioning pattern

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
SysAdmin 2025-09-27 09:46:13 +01:00
parent e75411dab9
commit 6be1ea8085
2 changed files with 16 additions and 0 deletions

View File

@ -5,6 +5,9 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>b96bedcb-5d39-4d41-98c0-72355dd49c1b</UserSecretsId> <UserSecretsId>b96bedcb-5d39-4d41-98c0-72355dd49c1b</UserSecretsId>
<Version>1.0.5</Version>
<AssemblyVersion>1.0.5.0</AssemblyVersion>
<FileVersion>1.0.5.0</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -280,6 +280,19 @@ app.MapHub<LittleShop.Hubs.ActivityHub>("/activityHub");
// Health check endpoint // Health check endpoint
app.MapHealthChecks("/health"); app.MapHealthChecks("/health");
// Version endpoint
app.MapGet("/api/version", () =>
{
var version = typeof(Program).Assembly.GetName().Version?.ToString() ?? "1.0.0";
var assemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0";
return Results.Ok(new
{
version = assemblyVersion,
environment = builder.Environment.EnvironmentName,
application = "LittleShop"
});
});
// Apply database migrations and seed data // Apply database migrations and seed data
using (var scope = app.Services.CreateScope()) using (var scope = app.Services.CreateScope())
{ {