title: Express server can't push data to AWS RDS?
body: <p>was hoping some of y'all would have some experience with this problem and point out something obvious that I'm probably missing. I have an express server and a PostgreSQL database, both running locally connected to a react native app. I've successfully connected an Amazon RDS instance to my Postgres DB. For example, when I my express server runs:</p>
  
  <pre><code>const User = sequelize.define('User', {
      email: {type: Sequelize.STRING, allowNull: false},
      password: {type: Sequelize.STRING, allowNull: false},
      user_id: {type: Sequelize.INTEGER, allowNull: true}
    }, {
        tableName: "UserTable"
    });
  
  User.sync({force: false}).then(() =&gt; {
      console.log('Table already exists!')
    });
  </code></pre>
  
  <p>a new table got created in the Postgres database, and it's synced with the RDS instance too. However, it throws a timeout error when this function is called in the react native app:</p>
  
  <pre><code>postData = () =&gt; {
      var url = 'http://123.456.7.891:3210/data'
      axios.post(url, {
        email: this.state.email,
        password: this.state.password
      })
      .then(function (response) {
        console.log(response);
      })
      .catch(function (error) {
          console.log("Api post error");
          alert(error.message);
          console.log(error);
      });
    };
  </code></pre>
  
  <p>This is the express endpoint it's calling, and before I connected to Amazon RDS and was simply running the whole thing locally, everything was working fine.</p>
  
  <pre><code>app.post('/data', function(req,res){
  User.create({
      email: req.body.email,
      password: req.body.password,
      user_id: 000,
  }).then(data =&gt; {
    console.log('Data entered!');
    res.send({
          status: 'Data successfully sent through api!',
          email: req.body.email,
          password: req.body.password
    })
  }).catch(function(error) {
      console.log('There has been a problem with your post operation: ' + error.message);
        throw error;
      });
  })
  </code></pre>
  
  <p>I suspect that my mistake is in the variable URL, and that I'm not supposed to send it back to localhost since now it's connected to an AWS RDS instance. However, that doesn't quite make sense to me because the express server is still supposed to be listening in on localhost port 3210.
  Any help would be greatly appreciated.</p>