I have the following Controller & Action that I want to be the first page that is loaded when the user enters my webapp:
[Route("auth")]
public class AuthController : Controller
{
[Route("signin")]
public IActionResult SignIn(bool signInError)
{
}
}
I try to do this in my app.UseMvc options like so:
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=auth}/{action=signin}/");
});
However, when I start my webapp it simply navigates to http://localhost:52608/.
If I type in http://localhost:52608/auth/signin?ReturnUrl=%2F the webpage loads correctly on the page I want to be on when the user starts the webapp.
My question is, how do I set this up so it can navigate to this page as soon as the user opens the webapp?
"applicationUrl": "http://localhost:52608/auth/signin"However, that will only work for debugging. To truly have the default page direct you to the/auth/signinURL you need to use a redirect in the Home controller as @garret suggests.