title: 500 Internal Server Error in simple Mean application
body: <p>I am doing a simple MEAN stack tutorial on Thinkster.io which involves creating a simple news app. When I try to post a new item to the server I get this  error, <code>POST http://localhost:3000/posts 500 (Internal Server Error)</code>. It is very vague and I have no idea how to debug it. In chrome I can only trace the error to this method.</p>
  
  <pre><code>//method in service
  o.create = function(post) {
          return $http.post('/posts', post).success(function(data) {
              o.posts.push(data);
      });
  };  
  </code></pre>
  
  <p>and</p>
  
  <pre><code>//usage
  $scope.addPost = function(){
          if(!$scope.title || $scope.title === ""){
              return;
          }
          posts.create({
              title: $scope.title,
              link: $scope.link,
              upvotes : 0,
              comments: [
              {author: "Joe", body: "Class!!", upvotes: 0},
              {author: "Coco", body: "Woof Woof!!", upvotes: 0}
              ]
              })
          $scope.title = "";
          $scope.link = "";
  };   
  </code></pre>
  
  <p>But the problem is obviously in the backend. Even if you are unwilling to sift through the code please outline how I can debug this for myself. Here is a link to my repo.
  <a href="https://github.com/MultiplisJoseph/news-trends" rel="nofollow noreferrer">Link to Github</a></p>
  
  <p>Chrome outputs</p>
  
  <pre><code>XHR finished loading: GET "http://localhost:3000/posts". angular.js:9818
  POST http://localhost:3000/posts 500 (Internal Server Error) angular.js:9818
  XHR finished loading: POST "http://localhost:3000/posts". angular.js:9818
  </code></pre>
  
  <p>CMD Outputs
  <a href="https://i.stack.imgur.com/2Pt5w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Pt5w.png" alt="enter image description here"></a></p>