ViteProxy is a proxy for vite projects within ASP.NET Core.
This project is meant to be used within server-side applications and not within SPAs (single-page applications).
Without ViteProxy you would have to start your server application (e.g. dotnet run) and additionally the vite dev server (e.g. npm run dev). The proxy is registered as a hosted service and started in tandem with the server application.
varbuilder=WebApplication.CreateBuilder(args);builder.Services.AddViteProxy();varapp=builder.Build();app.UseStaticFiles();app.UseViteStaticFiles();exportdefault{
...,server: {port: process.env.PORT||2341,cors: true},
...
};