title: Node connecting to Mongodb in my VPS with port 27017, no if I change the port
body: <p>I've got a Digital Ocean VPS, and followed their tutorial:
  <a href="https://www.digitalocean.com/community/tutorials/how-to-connect-node-js-to-a-mongodb-database-on-a-vps" rel="nofollow">link</a>
  It's working the app.js and connecting to the database.
  Here is the code of the apps file:</p>
  
  <pre><code>var MongoClient = require('mongodb').MongoClient
  , format = require('util').format;
  MongoClient.connect('mongodb://127.0.0.1:27017/test', function (err, db) {
      if (err) {
          throw err;
      } else {
          console.log("successfully connected to the database");
      }
      db.close();
  });
  </code></pre>
  
  <p>But if I change the port 127.0.0.1:27017  to 127.0.0.1:3500  the one I want to connect, it's not working.
  Here is my ufw</p>
  
  <pre><code>ufw allow 22/tcp
  ufw allow 3500/tcp
  ufw allow 80/tcp
  ufw allow 27017/tcp
  </code></pre>
  
  <p>Any help?
  Thank you</p>