using Microsoft.AspNetCore.Mvc;

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

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

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

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