From 701d474949e5cb72b8ed7b29fec45ad74580f570 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Tue, 8 Aug 2023 13:20:21 +1000 Subject: Initial commit --- DebugController.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 DebugController.cs (limited to 'DebugController.cs') diff --git a/DebugController.cs b/DebugController.cs new file mode 100644 index 0000000..7a87729 --- /dev/null +++ b/DebugController.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Mvc; + +namespace HyperBooru; + +#if DEBUG +[ApiController] +[Route("/debug")] +public class DebugController : Controller { + private HyperBooruDbContext db; + + public DebugController(HyperBooruDbContext db) => + this.db = db; + + [HttpGet("media")] + public IActionResult Media() => + Ok(db.Media.ToList()); + + [HttpGet("tags")] + public IActionResult TagDefinitions() => + Ok(db.Tags.ToList()); +} +#endif \ No newline at end of file -- cgit v1.3