title: MongoError : Server 127.0.0.1:3000 timed out at null
body: <p>I am getting an error in cmd when i run "node app.js" command.</p>
  
  <blockquote>
    <p>"facebook-auth\express-authentication" is my path to NodeJS project.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/SpCKY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SpCKY.png" alt="enter image description here"></a></p>
  
  <p>I run my MongoDB and i think it is working fine.
  <a href="https://i.stack.imgur.com/WRxhv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WRxhv.png" alt="mongod command"></a></p>
  
  <p>and</p>
  
  <p><a href="https://i.stack.imgur.com/3UbBf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3UbBf.png" alt="mongo command"></a></p>
  
  <p>When i use "node app.js" command in starting then my "<a href="http://127.0.0.1:3000" rel="nofollow noreferrer">http://127.0.0.1:3000</a>" server work fine but when i close all connections and try to restart mongoDB then is error occur everytime.
  I don't know how to solve this problem and this project is running fine in starting on <a href="http://127.0.0.1:3000" rel="nofollow noreferrer">http://127.0.0.1:3000</a>. But don't know what happened know. I closed my MongoDB using Ctrl+C.</p>
  
  <p>After adding this code</p>
  
  <blockquote>
    <p>// When successfully connected</p>
  </blockquote>
  
  <p><code>mongoose.connection.on('connected', function () { console.log('Mongoose default connection open to ' + dbURI); });</code></p>
  
  <blockquote>
    <p>// If the connection throws an error</p>
  </blockquote>
  
  <p><code>mongoose.connection.on('error',function (err) { console.log('Mongoose default connection error: ' + err); });</code></p>
  
  <p>to app.js it shows this:
  <a href="https://i.stack.imgur.com/uTnCB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uTnCB.png" alt="enter image description here"></a></p>
  
  <p>Showing an error and website authentication not work properly(But website is running now). It don't get callback information from localhost or 127.0.0.1. It keeps waiting for response for localhost and callback doesn't complete (stuck there).</p>
  
  <blockquote>
    <p>I follow this tutorial :<a href="http://www.danielgynn.com/build-an-authentication-app-using-express-node-passport/" rel="nofollow noreferrer">Here</a> and project is working fine.</p>
  </blockquote>
  
  <p>"Is this a conflict between xampp or mongoDB or nodeJS"</p>
  
  <p>App.js file linked <a href="http://pasted.co/82991f7a" rel="nofollow noreferrer">Here</a></p>
  
  <p>Thanks in advance for help.</p>