Skip to content

Commit a5d7c1d

Browse files
committed
feat: added meta info
1 parent 91c357f commit a5d7c1d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/OA/Controllers/MetaController.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Diagnostics;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace OA.Controllers
10+
{
11+
public class MetaController : ControllerBase
12+
{
13+
[HttpGet("/info")]
14+
public ActionResult<string> Info()
15+
{
16+
var assembly = typeof(Startup).Assembly;
17+
18+
var lastUpdate = System.IO.File.GetLastWriteTime(assembly.Location);
19+
var version = FileVersionInfo.GetVersionInfo(assembly.Location).ProductVersion;
20+
21+
return Ok($"Version: {version}, Last Updated: {lastUpdate}");
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)