title: AngularJS + Electron: Save Data to JSON File
body: <p>I'm very new to AngularJS and Electron, and i'm currently working on a simple desktop app that reads data from a JSON file and allows the user also update and delete data. I'm also using TaffyDB to query the data. I'm able get data from the JSON file but unable to store it in the JSON file.</p>
  
  <p>What i tried so far was this:</p>
  
  <pre><code>myApp.controller('homeController', ['$scope', '$http', function($scope, $http) {
  
      $scope.saveData = function() 
      {
          var data = $scope.data;
  
          $http.post('/src/db/db.json', data).then(function (response) {
  
              console.log(response);
  
          }, function (response) {
  
              console.log(response);
  
          });
      };
  
  }]);
  </code></pre>
  
  <p>Executing the event on the browser i get the following error:</p>
  
  <pre><code>POST http://127.0.0.1:64262/src/db/db.json 404 (Not Found)
  </code></pre>
  
  <p>This is normal because we cannot access the user's filesystem from javascript.</p>
  
  <p>When i execute the app as a Electron package, i get the following:</p>
  
  <pre><code>Object {data: Array[2], status: 200, config: Object, statusText: "OK"}
  </code></pre>
  
  <p>But the file was not modified.</p>
  
  <p>I would like to know if there is any way i can accomplish this using AngularJS and Electron.</p>
  
  <p><strong>Important Note</strong>: This app needs to run as a standalone desktop application. In other words, my client doesn't what to install other software or apps to be able to use this application.</p>