For Asp.Net Core 3.1 projects, how do I remove the requirement to have /Home
in the url for actions in the Home
controller?
I tried decorating the controller with the attribute [Route("/")]
but it does not work.
The start up configuration is the default from Visual Studio's template:
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
endpoints.MapRazorPages();
});