2023-02-22 12:12:38 +01:00
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace WebAPI.Controllers
|
|
|
|
|
{
|
|
|
|
|
[ApiController]
|
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
|
[Authorize]
|
|
|
|
|
public class PingController : Controller
|
|
|
|
|
{
|
2024-06-18 18:39:02 +02:00
|
|
|
private readonly IConfiguration _configuration;
|
2023-02-22 12:12:38 +01:00
|
|
|
public PingController(
|
2024-06-18 18:39:02 +02:00
|
|
|
IConfiguration configuration)
|
2023-02-22 12:12:38 +01:00
|
|
|
{
|
2024-06-18 18:39:02 +02:00
|
|
|
_configuration = configuration;
|
2023-02-22 12:12:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("Ping")]
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
public IActionResult Ping()
|
|
|
|
|
{
|
2024-06-18 18:39:02 +02:00
|
|
|
return Ok(_configuration["PONG"]);
|
2023-02-22 12:12:38 +01:00
|
|
|
}
|
|
|
|
|
}
|
2022-12-06 12:27:09 +01:00
|
|
|
}
|