title: GET http://localhost: postman
body: <p>I'm using MEAN stack as my back-end. this is my server js file </p>
  
  <pre><code>const users = require('./routes/users');
  app.get('/', (req, res) =&gt; { 
      res.send('Invalid endpoint');
  });
  </code></pre>
  
  <p>This is my routes file users.js</p>
  
  <pre><code>router.get('/jobdetail', function(req,res) {
    console.log('fetching jobs');
    jobDetails.find({}, (err,jobs) =&gt; {
      if(err) {
        console.log(err);
      }
      else {
        res.json(jobs);
      }
    });
  });
  </code></pre>
  
  <p>when I run it the postman bu url:</p>
  
  <blockquote>
    <p>localhost:3000/api/jobdetail</p>
  </blockquote>
  
  <p>Instead of the data from MongoDB I get the response as </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;title&gt;Error&lt;/title&gt;
          &lt;script type="text/javascript" src="http://gc.kis.v2.scr.kaspersky-labs.com/D11634C0-514E-C94E-9DFD-54EBD0B16E5F/main.js" charset="UTF-8"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;pre&gt;Cannot GET /api/jobdetail&lt;/pre&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>