import pathToRegexp from 'path-to-regexp';
// real route
const route = '/notifications/:id/';
// regexp
const keys = [];
const regexp = pathToRegexp(route, keys);
// test route
const testRoute = '/notifications/123/';
if (regexp.exec(testRoute)) {
console.log(`URL match from: ${route}`);
} else {
console.log(`URL not match from: ${route}`);
}