using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; namespace WebUI { public class HomeController : Controller { private readonly IWebHostEnvironment _env; private readonly IConfiguration _cfg; public HomeController(IWebHostEnvironment env,IConfiguration cfg) { this._env = env; this._cfg = cfg; } public IActionResult Index() { if(this._cfg.GetValue("FrontEnd")) { return File("~/index.html", "text/html"); } return View(); } } }