Why am I getting a 404 on this in react with node
<p>I am trying to send the data inserted into form to server via ajax request like this:</p>

<pre><code> handleUserSubmit: function(user) {
   var users = this.state.data;
   user.id = Date.now();
   var newUsers = users.concat([user]);
   this.setState({data: newUsers});
   $.ajax({
     url: this.props.url,
     dataType: 'json',
     type: 'POST',
     data: user,
     success: function(data) {
       this.setState({data: data});
     }.bind(this),
     error: function(xhr, status, err) {
       this.setState({data: users});
       console.error(this.props.url, status, err.toString());
     }.bind(this)
   });
 },
</code></pre>

<p>and the rendering is done as:</p>

<pre><code>ReactDOM.render(
  &lt;UserBox url="../users" pollInterval={2000} /&gt;,
  document.getElementById('data')
);
</code></pre>

<p>I am getting this weird console error:</p>

<pre><code>POST http://localhost:3000/users 404 (Not Found)
</code></pre>

<p>Since the "users" file (assuming it's trying to access users.json file is in a directory up one level). I have tried all variation possible : "./users", "../users", "#/users" etc...</p>

<p>The code error on this line:</p>

<pre><code>url: this.props.url,
</code></pre>

<p>in the code given above. Any idea what's going on?</p>

<p>My node.js code is:</p>

<pre><code>app.post('/users', function(req, res) {
  fs.readFile(USERDATA, function(err, data) {
    if (err) {
      console.error(err);
      process.exit(1);
    }
    var users = JSON.parse(data);
    var newUser = {
      id: Date.now(),
      firstname: req.body.firstname,
      lastname: req.body.lastname,
      address: req.body.address,
      phonenumber: req.body.phonenumber,
      email: req.body.email,
      licensestate: req.body.licensestate,
      licensenum: req.body.licensenum
    };
    console.log(newUser)
    users.push(newUser);
    fs.writeFile(USERDATA, JSON.stringify(users, null, 10),              

function(err) {
      if (err) {
        console.error(err);
        process.exit(1);
      }
      res.json(users);
        });
      });
     }); 
</code></pre>