I would like to check the route when receiving a request in nodejs (10.16) and express (4.16) project. The server listens to port 3000 on localhost
. Here is a users
route:
const users = require('../routes/users');
module.exports = function(app, io) {
app.use('/api/users', users);
}
In route users.js
, there is:
router.post('/new', async (req, res) => {...}
When a route is called (ex, ${GLOBAL.BASE_URL}/api/users/new
), how do I know which route is being called from the param req
?