var express = require('express');
var exampleRouter = express.Router();
exampleRouter.get([
'/example/cat/:id/subcat/:subId', /*1st URL*/
'/example/:id/:subId/', /*2nd URL*/
],function(req, res){
if( *1st url condition*){ // It should enter here
/*do something..*/
}else if( *2nd url condition* ){
/*do something..*/
}
});
Suppose the request from browser is like this http://www.example.com/example/cat/1/subcat/2
What should be the 1st Url condition?