using Microsoft.AspNetCore.Mvc;

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

		[HttpGet("/WebNew/Regulasi/GetRegulasi")]
        public IActionResult GetRegulasi()
        {
            var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/webnew/json", "regulasi.json");

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

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