title: when running node with express gives me 'cannot GET' error in the browser
body: <p>i'm trying to make a single page application and in the backend part i already have the code but when i want to make checks with postman of my api rest and run the server i get an error</p>
  
  <pre><code>'use strict';
  
  require('dotenv').config();
  const bodyParser = require('body-parser');
  const cors = require('cors');
  const express = require('express');
  const routes = require('./webserver/routes');
  const mysqlPool = require('./ddbb/mysql-pool');
  
  
  process.on("uncaughtException", err =&gt; {
      console.error("unexpected exception", err.message, err);
    });  
  
    process.on("unhandledRejection", err =&gt; {  
      console.error("unexpected error", err.message, err);  
    });
  
  const app = express();
  app.use(bodyParser.json());
  
  app.use((err, req, res, next) =&gt; {
      console.error(err);
      res.status(400).send({
          error: `Body parser: ${err.message}`,
      });
  });
  
  /**
  
   * Enable CORS 
  
   */
  
  app.use((req, res, next) =&gt; {
      res.header('Access-Control-Allow-Origin', '*');
      res.header('Access-Control-Allow-Headers', 'Authorization, X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Allow-Request-Method');
      res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, DELETE');
      res.header('Allow', 'GET, POST, OPTIONS, PUT, DELETE');
      next();
  });
  
  app.use('/api', routes.accountRouter);
  app.use('/api', routes.userRouter);
  
  app.use((err, req, res, next) =&gt; {
      const { name: errorName } = err;  
      if (errorName === "AccountNotActivatedError") {  
        return res.status(403).send({  
          message: err.message  
        });  
      }  
      return res.status(500).send({  
        error: err.message  
      });  
    });
  
  async function init() {
      try {
          await mysqlPool.connect();
      } catch(e) {
          console.error(e);
          process.exit(1);
      }
      const port = process.env.PORT;
      app.listen(port, () =&gt; {
          console.log(`Server running and listening on port ${port}`);
          });
  }
  
  init();
  
  </code></pre>
  
  <p>in the visual studio terminal tells me that the server is listening and running on the assigned port but in the browser gives me the error 'cannot GET' and postman does not connect me</p>