express Explain Routing in Express Express Router


Express router allows you to create multiple "mini apps" so you can namespace your api, public, auth and other routes into separate routing systems.

var express   = require('express');
var app       = express();
var router    = express.Router();

router.get('/', function(req, res){
   res.send('Get request received');
});'/', function(req, res){
   res.send('Post requestreceived');

app.use('/', router);