title: Difference in response status codes in ajax call between client and server
body: <p>SetUp: - <code>Node/Express/Angular 1.x</code></p>
  
  <p>Problem - The response code received by client over the ajax call is 200 always (provided it is successful) irrespective of Server Response where response Headers gives 304 or 200 (checked in server console, browser networks response headers). Why do we have this difference?</p>
  
  <p>On load of my application, following call is made from client code </p>
  
  <pre><code>getTeamInfo() {
          return this.$http
              .get(`${this.ApiUrl}`)
              .then((response) =&gt; {
                  if (!response.data) {
                      console.log('could not obtain team information');
                  } else {
                      //Always **200** for every successful response
                      console.log('TeamInfo Call status .. ', response.status); 
                      return response.data;
                  }
              });
      }
  </code></pre>
  
  <p>Server has route setup like <code>app.use('/teams', teams.teamInfo);</code> where <code>teams = new TeamController();</code></p>
  
  <pre><code>    function TeamController(){
         this.teamInfo= function(req, res){
              var teamsInfo = {};
              if(req.session &amp;&amp; req.session.teams){
                  teams = req.session.teams;
                  teamsInfo = {
                      name: teams.attributes.name + ' - ' + teams.attributes.slogan
                  };
              }
              //Express console gives GET /teams 304 or 200
              res.send(teamsInfo);
          };
      }
  </code></pre>