buildout full stack functionality
This commit is contained in:
29
backend/Controllers/InfoController.cs
Normal file
29
backend/Controllers/InfoController.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Backend.Controllers;
|
||||
|
||||
[Route("v1/[controller]")]
|
||||
[ApiController]
|
||||
public class InfoController : ControllerBase
|
||||
{
|
||||
private readonly IWebHostEnvironment _environment;
|
||||
|
||||
public InfoController(IWebHostEnvironment environment)
|
||||
{
|
||||
_environment = environment;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Get()
|
||||
{
|
||||
var assembly = typeof(InfoController).Assembly.GetName();
|
||||
|
||||
return Ok(new
|
||||
{
|
||||
name = assembly.Name ?? "backend",
|
||||
version = assembly.Version?.ToString(3) ?? "0.0.0",
|
||||
environment = _environment.EnvironmentName,
|
||||
timestamp = DateTime.UtcNow,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user