
var myroutes = [
  { path: '/users', handler: 1 },
  { path: '/user/:userID', handler: 2 }
];

function _match( path ){
   return routes.filter( route => ( path.match( new RegExp( route.path ) ) )  );
 };
let results = _match( '/apps' );
console.log( 'route match:' + results );

console.log( results.length );

results = _match( '/user/21' );
console.log( 'route match:' + results );

console.log( results.length );

