initial version.

feat: automatically run vite dev server when in Debugger mode.
feat: supports hotreload on both js frontend and .net backend.
This commit is contained in:
lchen committed 2026-10-21 14:11:15 +08:00
1 parent f925e00540
commit 5c81ed18b2
25 files changed
+743

No files matched your search

@@ -0,0 +1,32 @@
using Microsoft.AspNetCore.Mvc;
namespace WebApplication1.Controllers;
[Route("")]
public class DefaultController(ViteHelper vite) : SiteControllerBase(vite)
{
[HttpGet]
public async Task<IActionResult> Get()
{
if (!Request.Path.HasValue || !Request.Path.Value.EndsWith('/'))
{
return RedirectPermanent($"{Request.PathBase}/{Request.QueryString}");
}
var html = await viteHelper.RenderAsync(
Request.PathBase,
"Templates/main.html",
"src/main.ts",
new() { ["Title"] = "Home Page" });
return Content(html, "text/html; charset=utf-8");
}
[Route("test/error")]
[HttpGet]
[ResponseCache(CacheProfileName = "NoCache")]
public IActionResult GetTest()
{
throw new PermissionException(400, errorMessage: "This is a test permission exception.");
}
}