I have this angularjs service:
function checkCredentials(username,password) {
return $http.post(config.baseUrl + "api/login/", username, password)
}
And this web api:
public class LoginController : ApiController
{
private MorenoContext _context;
public LoginController()
{
_context = new MorenoContext();
}
[HttpPost]
public async Task<IHttpActionResult> Post(string username, string password)
{
return Ok("test");
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
_context.Dispose();
}
base.Dispose(disposing);
}
}
But when try to call web api method with help of checkCredentials() client function I get this error:
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost/myProjectName/api/login/
Any idea why I get the error?