title: the router doesn't select correct function
body: <p>When I use <code>postman</code> to login a user with <code>http://localhost:3000/login</code> but it always run the register function. Code runs ok, it just routes to wrong function. How to redirect it to <code>login</code> when the url is login and vice-versa. Both the login and register functions are in the same <code>authentication.js</code> file.</p>
  <p><strong>controllers/authentication.js</strong></p>
  <pre><code>exports.register = (req, res) =&gt; {
  
  [Some long code here]
  
   });
  
  
  exports.login = (req, res, next) =&gt; { 
  
  [Some long code here]
  
   });
  </code></pre>
  <p><strong>routes/index.js</strong></p>
  <pre><code>const express = require(&quot;express&quot;);
  const ctrlAuth = require(&quot;../../controllers/authentication&quot;);
  const router = express.Router();
  
  router.post('/', ctrlAuth.register);
  router.post('/', ctrlAuth.login);
  
  module.exports = router;
  </code></pre>
  <p><strong>app.js</strong></p>
  <pre><code>const userRoutes = require(&quot;./app_api/routes/index&quot;);
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: false }));
  
  app.use(&quot;/login&quot;, userRoutes);
  app.use(&quot;/register&quot;, userRoutes);
  module.exports = app;
  </code></pre>