title: Axios - How to fix - POST URL net::ERR_CONNECTION_RESET
body: <p>How to fix this error message?</p>
  <pre><code>[xhr.js?b50d:178 POST http://localhost:3000/editor/add net::ERR_CONNECTION_RESET][1]
  </code></pre>
  <p>It works and append data, but I get this error message...</p>
  <p>My API looks like this:</p>
  <p><a href="https://i.stack.imgur.com/xUkhd.png" rel="nofollow noreferrer">app.js</a></p>
  <pre><code>app.post('/editor/add', function (req, res) {
  let articleData; 
  let textData;
  let article = {
      title: req.body.title,
      content: req.body.content
  }
  
  fs.readFile(urlPath, 'utf8', (err, data) =&gt; {
      if (err) {
          console.log('readfile =&gt; ' + err);
      } else {
          articleData = JSON.parse(data);
          articleData[article.title] = article.content;
          textData = JSON.stringify(articleData, null, 2);
  
          fs.writeFile(urlPath, textData, 'utf8', (err) =&gt; {
              if (err) {
                  console.log('write file =&gt; ' + err);
              } else {
                  console.log('Finished writing');
              }
          });
      }
  });
  </code></pre>
  <p>});</p>
  <p>And my Axios POST method looks like this.</p>
  <p><a href="https://i.stack.imgur.com/7JsNV.png" rel="nofollow noreferrer">editor.vue</a></p>
  <pre><code>submitEditor: function() {
    var self = this;
    self.$axios({
        headers: {
          &quot;Content-Type&quot;: &quot;application/json&quot;
        },
        method: &quot;post&quot;,
        url: &quot;http://localhost:3000/editor/add&quot;,
        data: {
          title: &quot;test5&quot;,
          content: self.html
        }
      })
      .then(res =&gt; {
        console.log(res);
      })
      .catch(error =&gt; {
        if (!error.response) {
          // network error
          this.errorStatus = &quot;Error: Network Error&quot;;
        } else {
          this.errorStatus = error.response.data.message;
        }
      });
  }
  </code></pre>
  <p>I use Vue/cli, I separate my client code and my server code. They are on a separate folder. I put Vue/cli in my client folder, and express.js in my server folder.</p>
  <p>Thank you in advance!</p>