http.post angularjs 404 error
<p>I'm trying to post form data to a mongodb (moongose) using the angularjs http.post method and I'm getting a 404 error not sure I'm doing this correctly. It complains it cant find the url -> POST <a href="http://localhost:5000/tournaments/56bf2ea58e5ea932088ff356/games" rel="nofollow">http://localhost:5000/tournaments/56bf2ea58e5ea932088ff356/games</a> 404 (Not Found)</p>

###### This is my api router

<pre><code>router.post('/tournaments/:id/games', function(req, res) {

  var newGame  = {};
  newGame.id = req.body.id;
  newGame.gameDate = req.body.gameDate;
  newGame.homeTeam = req.body.homeTeam;
  newGame.awayTeam = req.body.awayTeam;
  newGame.homeTeamScore = req.body.homeTeamScore;
  newGame.awayTeamScore = req.body.awayTeamScore;
  newGame.hadOT = req.body.hadOT;
  newGame.hadSO = req.body.hadSO;

  Tournament.update({ "_id": req.params.id}, {$push: {games: newGame}}, function(err, model) {
    if(err) {
      res.send(err)
    } else {
      res.json(model)
    }
  });
});
</code></pre>

this is in the controller

<pre><code>vm.isEditing = false;
 vm.newGame = {
  awayTeam: '',
  homeTeam: '',
  homeTeamScore: 0,
  awayTeamScore: 0
};
vm.showModal = function() {
  vm.isEditing = true;
}
vm.hideModal = function() {
  vm.isEditing = false;
  vm.addGameForm.$setPristine();
  vm.isSaving = true;
}

vm.addGame = function() {
  vm.isSaving = true;
  vm.newGame.id = vm.selectedTournament.games.length + 1;
  $http({
      method  : 'POST',
      url     : '/tournaments/'+tournamentId+'/games',
      data    : $.param($scope.vm.newGame),
      headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
  }).success(function(response){
      $scope.vm.newGame = {};
      $scope.games = response;
      console.log(response);
  })
  .error(function(data) {
    console.log('Error: ' + data);
  });

  vm.addGameForm.$setPristine();
  vm.hideModal();

}
</code></pre>