title: Localhost:3000 not opening from node.js app
body: <p>I've set up a tiny little app which is run using Express, Nodemon and Mongoose.</p>
  <p>A few hours ago, it worked fine - and I don't think I've changed any of the code then. If I have, it must have been accidentally.</p>
  <p>But whenever I try to access my localhost for this particular app, it doesn't load. It just sits in this state of loading. No errors appear, the console is clear and it states 'Running on Port 3000'.</p>
  <p>If I try other apps, they work fine on localhost, so it must be the code - but I don't even know where to start considering there's no error messages.</p>
  <p>Here's my code:</p>
  <pre><code>const express = require(&quot;express&quot;);
  const bodyParser = require(&quot;body-parser&quot;);
  const mongoose = require(&quot;mongoose&quot;);
  const Schema = mongoose.Schema;
  var encrypt = require('mongoose-encryption');
  
  require(&quot;dotenv&quot;).config();
  
  const app = express();
  
  mongoose.connect(process.env.MONGO_URI, {useNewUrlParser: true, useUnifiedTopology: true});
  
    const SubmitDebtSchema = new Schema ({
      balance: [{
        balanceDate: Date,
        newBalance: Number
      }],
      monthly: Number,
      date: String,
      autoBalance: String
    });
  
    const encKey = process.env.ENCKEY;
    const sigKey = process.env.SIGKEY;
  
    SubmitDebtSchema.plugin(encrypt, { encryptionKey: encKey, signingKey: sigKey, excludeFromEncryption: ['autoBalance'] });
  
    const SubmitDebt = mongoose.model('submitdebt', SubmitDebtSchema);
  
    app.get(&quot;/&quot;, async (req, res) =&gt; {
  
    const debts = await SubmitDebt.find({ autoBalance: true });
  
    debts.map(debt =&gt; {
  
      console.log(debt.id);
  
    const debtDate = parseInt(debt.date);
    const finalDate = new Date(new Date().setDate(debtDate));
  
    console.log(finalDate);
  
    const todaysDate = new Date();
  
    console.log(todaysDate);
  
    const debtBalance = debt.balance[debt.balance.length - 1].newBalance;
  
    console.log(debtBalance);
  
    const debtRepayment = debt.monthly;
  
    console.log(debtRepayment);
  
    const updatedBalance = { balanceDate: new Date(), newBalance: debtBalance - debtRepayment };
    console.log(updatedBalance);
  
    if (todaysDate &lt; finalDate) {
      console.log(&quot;Balance shouldn't change.&quot;);
    }
  
    if (todaysDate &gt;= finalDate) {
      console.log(&quot;Balance should change&quot;);
      SubmitDebt.findById(debt._id, (err, submitdebt) =&gt; {
        if (!submitdebt) {
          console.log(&quot;Unable to find entry to edit.&quot;);
        }
        else {
          submitdebt.balance.push(updatedBalance);
  
          submitdebt.save().then(submitdebt =&gt; {
            console.log(&quot;Debt successfully updated.&quot;);
          })
          .catch(err =&gt; {
            console.log(&quot;Debt unsuccessfully updated.&quot;);
          });
        }
      });
    }
  
  
    res.send(debts);
  
    });
  
  });
  
  const PORT = process.env.PORT || 3000;
  app.listen(PORT, () =&gt; {
      console.log(`Lemio is running on port ${ PORT }`);
  });
  </code></pre>
  <p>Can anyone spot any reason why my localhost isn't working for this app? Feel like I'm missing something obvious!</p>