title: Setting timeout in $http Service AngularJS 1.5.5
body: <p>I have my controller calling the api and by the time the api returns results I have the 500 Internal server in the chrome console popping up. I am using angular 1.5.5, could you please help with some timeout code.</p>
  
  <p>Tried using <code>.timeout(3000,new Error(timeout exceeded))</code> before <code>.then</code> but it does not compile</p>
  
  <pre><code>angular.module('myApp').factory('submitService',function($http)){
      var service={};
      service.getJwtToken=function(user)
      {
          return $http({
              method: "POST",
              url:"http://localhost:5000/jwtTest",
              data: user
          }).then(function(resp){
              return resp;
          });
      }
      return service;
  });
  </code></pre>