libs/scully/src/lib/utils/serverstuff/handleUnknownRoute.js
/** helper function to match paths to their unhandled that might include vars and stars */
helper function to match paths to their unhandled that might include vars and stars
helper function to match paths to their unhandled that might include vars and stars
function matchRoute(req) {
    return (route) => {
        try {
            const path = req.url;
            if (route.endsWith('**') && route.length > 3) {
                const base = route.slice(0, route.length - 3);
                return path.startsWith(base);
            }
            else {
                const regex = pathToRegexp(route);
                const match = regex.test(path);
                return match;
            }
        }
        catch (e) {
        }
        return false;
    };
}
function matchRoute ( req ) { return ( route ) => { try { const path = req . url ; if ( route . endsWith ( '**' ) && route . length > 3 ) { const base = route . slice ( 0 , route . length - 3 ) ; return path . startsWith ( base ) ; } else { const regex = pathToRegexp ( route ) ; const match = regex . test ( path ) ; return match ; } } catch ( e ) { } return false ; } ; }
helper function to match paths to their unhandled that might include vars and stars
helper function to match paths to their unhandled that might include vars and stars
/** handle angular wildcard route but exclude the `/**`  */ /** use the routematcher express is using */ /** something blew up with unexpected paths/routes means -no match anyway */ // console.log(req.url, r);