I am having difficulties defining login and register routes without a controller prefix. I have a user controller that has the methods for "Login(String email, String password)" and "Register(User user)".
The format I want to achieve is "api/login" and "api/register".
I tried the following code for login:
config.Routes.MapHttpRoute(
name: "Login",
routeTemplate: "api/login",
defaults: new { controller = "Users", action = "Login" });
However, I get this error:
{
"Message": "No HTTP resource was found that matches the request URI 'http://localhost:50145/api/login/'.",
"MessageDetail": "No type was found that matches the controller named 'login'."
}