From 9ec6295a0480f349b090048ed0e39218e24bc769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miskolczi=20Rich=C3=A1rd?= Date: Wed, 22 Nov 2023 12:08:03 +0100 Subject: [PATCH] Started working on API --- .../DatabaseController.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 WD7UVN_HFT_2023241.Endpoint/DatabaseController.cs diff --git a/WD7UVN_HFT_2023241.Endpoint/DatabaseController.cs b/WD7UVN_HFT_2023241.Endpoint/DatabaseController.cs new file mode 100644 index 0000000..5bb7e78 --- /dev/null +++ b/WD7UVN_HFT_2023241.Endpoint/DatabaseController.cs @@ -0,0 +1,22 @@ +using WD7UVN_HFT_2023241.Logic; +using Microsoft.AspNetCore.Mvc; + +namespace WD7UVN_HFT_2023241.Endpoint +{ + [ApiController] + [Route("api/[controller]")] + public class DatabaseController : ControllerBase + { + [HttpGet] + public IActionResult Get() + { + return Ok("This is a GET request."); + } + + [HttpPost] + public IActionResult Post([FromBody] string value) + { + return Ok($"Received POST request with value: {value}"); + } + } +}