title: Failed to load resource: net::ERR_CONNECTION_REFUSED, when i post the request. I'm using angular JS, node JS and gulp to insert to my JSON
body: <p>.controller("addContact",function($scope,$http){
      $scope.add=function(){</p>
  
  <pre><code>    var myContact={
          "department":$scope.department,
          "name":$scope.name,
          "model":$scope.model,
          "year":$scope.year,
          "price":$scope.price
      };
      console.log(myContact);
      $http.post("/addItem",myContact)
          .then(function(response){
          console.log(response);
      });
  </code></pre>
  
  <p>public.post('/addItem',function(request,response){
      console.log("incoming data=" +request.body);</p>
  
  <pre><code>fs.readFile(__dirname + "/public/items.json", 'utf-8', function(err, data) {
      console.log('file data' + data);
      var fileJsonData = data;
      var newContact = request.body;
      newContact.id = fileJsonData.items.length + 1;
      console.log("newContact=" + JSON.stringify(newContact));
      fileJsonData.items.push(newContact);
      var stringFile = JSON.stringify(fileJsonData);
      fs.writeFile(__dirname + "/items.json", stringFile);
      response.send(stringFile);
  
  });
  </code></pre>
  
  <p>});</p>