#23 Controleur et vue contact ok

This commit is contained in:
josephine.vetu
2026-03-05 15:42:18 +01:00
parent eeddeb4e43
commit a70b556379
7 changed files with 87 additions and 6 deletions

View File

@@ -0,0 +1,32 @@
using Microsoft.AspNetCore.Mvc;
namespace Webzine.WebApplication.Controllers;
public class ApiController : ControllerBase
{
private readonly ILogger<ApiController> _logger;
public ApiController(ILogger<ApiController> logger)
{
this._logger = logger;
this._logger.LogDebug(1, "NLog injected into VersionController");
}
[HttpGet]
public string HelloWorld()
{
return "Hello World !";
}
[HttpGet]
public IActionResult Version()
{
this._logger.LogInformation("Get Version was called");
return Ok(new
{
nom = "webzine",
version = "1.0",
});
}
}