title: AngularJS pushing/updating new data (likes/dislikes) to API using PUT
body: <p>I am trying to create an app that counts likes for beer! This would updates the API the beers are stored on and in turn update the number of likes on the API and angularJS view using the PUT method. I am able to get the view to work correctly increasing every time the like is clicked. I am unsure why my PUT method continues to return a 404 and will not update the API. please see code below for my put method. I have also included my JS and HTML for this. I feel like I am close but cannot figure out how to get the "likes" to update on the API. Thank you in advance!! I think i am passing incorrect data to the PUT method.</p>
  
  <p><strong>HTML</strong>:</p>
  
  <pre><code>&lt;div ng-app="beerApp" ng-controller="BeerController" class="jumbotron"&gt;
      &lt;div class="all-beer"&gt;
          &lt;div class="single-beer" ng-repeat="beer in allBeer"&gt;
              &lt;div&gt;{{beer.name}}&lt;/div&gt;
              &lt;div&gt;{{beer.likes}}&lt;/div&gt;
              &lt;button ng-click="decrease(beer)"&gt;X&lt;/button&gt;
              &lt;button ng-click="increase(beer)"&gt;\3&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>JS</strong>:</p>
  
  <pre><code> angular.module('beerApp', []).controller('BeerController', function($scope, $http) {
  
               $scope.allBeer = [];
               $scope.beerSum = function() {
               $http({
                  method: 'GET',
                  url: /api/beers
                }).
               then( function(response) {
  
               if(typeof response === 'object') {
                  var dataArr = response.data;
                  for (var i = 0; i &lt; dataArr.length; i++) {
                      var beer = dataArr[i];
  
                      $scope.allBeer.push(beer);
                  }
  
              } else {
                  return;
              }
  
              }, function(error) {
              console.log('i am an error', error);
              })
            };
  
            $scope.beerSum();
  
            $scope.increase = function(beer){
  
            var newLikes = beer.likes++;
  
            $http({
              method: 'PUT',
              url: '/api/beer/',
              data: JSON.stringify($scope.allBeer.likes),
          }).then(function successCallback(response) {
              console.log("Updated!");
          }, function errorCallback(response) {
              console.log("not updated")
  
          });
  
      };
  </code></pre>