Implement ApiController with version endpoint and logging

This commit is contained in:
mirage
2026-03-03 16:39:54 +01:00
parent 86a87f75ce
commit cb5fff33e7

View File

@@ -1,20 +1,19 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace Webzine.WebApplication.Controllers.api; namespace Webzine.WebApplication.Controllers;
[Route("api/[controller]")] public class ApiController : ControllerBase
public class VersionController : ControllerBase
{ {
private readonly ILogger<VersionController> _logger; private readonly ILogger<ApiController> _logger;
public VersionController(ILogger<VersionController> logger) public ApiController(ILogger<ApiController> logger)
{ {
this._logger = logger; this._logger = logger;
this._logger.LogDebug(1, "NLog injected into VersionController"); this._logger.LogDebug(1, "NLog injected into VersionController");
} }
[HttpGet] [HttpGet]
public IActionResult Get() public IActionResult Version()
{ {
this._logger.LogInformation("Get Version was called"); this._logger.LogInformation("Get Version was called");