using Microsoft.AspNetCore.Mvc;

public class LayananController : Controller
{
    public IActionResult Index(string jenis)
    {
        ViewBag.Jenis = jenis;
        return View();
    }

    public IActionResult GetData(string jenis)
    {
        var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/json/Layanan", $"{jenis}.json");

        if (!System.IO.File.Exists(path))
            return NotFound();

        var json = System.IO.File.ReadAllText(path);
        return Content(json, "application/json");
    }
}