using Microsoft.AspNetCore.Mvc;

namespace WebApplication2.Controllers
{
    public class RegulasiController : Controller
    {
        public IActionResult Index()
        {
            return View("~/Views/Regulasi.cshtml");
        }

        public IActionResult GetRegulasi()
        {
            var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/json", "regulasi.json");

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

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