Hi,
I'm using the extension and have it set up in Program.cs like this:
if (app.Environment.IsDevelopment())
{
app.UseViteDevelopmentServer(true);
// Use dev error screen with a more detailed message.
app.UseStatusCodePagesWithReExecute("/Home/ErrorDev", "?statusCode={0}");
}
My web app uses Razor MVC pages in a few places - currently login and a legacy UI. We also use plain HTML Razor to serve the error page and log 404s and other abnormal requests. We wish to keep the Razor/MVC pages for login and 404s, it suits us because the app is split into 2 sections:
The vite app has two entry points that 'boot' from a Razor page (eg, /client/ui, /mynd/ui), and I have this working successfully. I also have routing configured to redirect all requests under this route to Vite, so the webapp handles the routing from there. All as expected.

Yet it seems to intercept other requests - /api, and anything that should show my 404 page. Instead of showing the api route, or showing the 404 on other routes that don't fall under the two SPA routes I get the default Vue/Vite page, aka index.html in the Vite/SPA root directory:

I don't want it to do this, instead it should either serve a 404 page as indicated by app.UseStatusCodePagesWithReExecute("/Home/ErrorDev", "?statusCode={0}"); or the API route. Is it possible to tell the middleware that everything not under the /client/ui and /mynd/ui routes should not be intercepted and should instead be routed to ASP.NET MVC?
Hi,
I'm using the extension and have it set up in Program.cs like this:
My web app uses Razor MVC pages in a few places - currently login and a legacy UI. We also use plain HTML Razor to serve the error page and log 404s and other abnormal requests. We wish to keep the Razor/MVC pages for login and 404s, it suits us because the app is split into 2 sections:
The vite app has two entry points that 'boot' from a Razor page (eg, /client/ui, /mynd/ui), and I have this working successfully. I also have routing configured to redirect all requests under this route to Vite, so the webapp handles the routing from there. All as expected.
Yet it seems to intercept other requests - /api, and anything that should show my 404 page. Instead of showing the api route, or showing the 404 on other routes that don't fall under the two SPA routes I get the default Vue/Vite page, aka index.html in the Vite/SPA root directory:
I don't want it to do this, instead it should either serve a 404 page as indicated by
app.UseStatusCodePagesWithReExecute("/Home/ErrorDev", "?statusCode={0}");or the API route. Is it possible to tell the middleware that everything not under the /client/ui and /mynd/ui routes should not be intercepted and should instead be routed to ASP.NET MVC?