From 0b202b43b08f664498d83b4520e294ade15bfd6f Mon Sep 17 00:00:00 2001 From: "Stein A. Hoem" Date: Fri, 13 Dec 2024 08:44:35 +0100 Subject: [PATCH] fix issue #98 --- Nbic.References/Controllers/PingController.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Nbic.References/Controllers/PingController.cs diff --git a/Nbic.References/Controllers/PingController.cs b/Nbic.References/Controllers/PingController.cs new file mode 100644 index 0000000..1a8d71b --- /dev/null +++ b/Nbic.References/Controllers/PingController.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; + +namespace Nbic.References.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [SwaggerTag("Check status and authentication")] + public class PingController : ControllerBase + { + [HttpGet] + [Route("Ping")] + public string Ping() + { + return "Ok!"; + } + + [HttpGet] + [Authorize("WriteAccess")] + [Route("AuthorisedPing")] + public string AuthorisedPing() + { + return "Ok!"; + } + } +}