modules/@themost/web/handlers/view.js
function queryController(requestUri) {
    try {
        if (requestUri === undefined)
            return null;
        //split path
        var segments = requestUri.pathname.split('/');
        //put an exception for root controller
        //maybe this is unnecessary exception but we need to search for root controller e.g. /index.html, /about.html
        if (segments.length === 2)
            return 'root';
        else
        //e.g /pages/about where segments are ['','pages','about']
        //and the controller of course is always the second segment.
            return segments[1];
    }
    catch (err) {
        throw err;
    }
}
function queryController(requestUri) {
    try {
        if (requestUri === undefined)
            return null;
        //split path
        var segments = requestUri.pathname.split('/');
        //put an exception for root controller
        //maybe this is unnecessary exception but we need to search for root controller e.g. /index.html, /about.html
        if (segments.length === 2)
            return 'root';
        else
        //e.g /pages/about where segments are ['','pages','about']
        //and the controller of course is always the second segment.
            return segments[1];
    }
    catch (err) {
        throw err;
    }
}
function queryController ( requestUri ) { try { if ( requestUri === undefined ) return null ; //split path var segments = requestUri . pathname . split ( '/' ) ; //put an exception for root controller //maybe this is unnecessary exception but we need to search for root controller e.g. /index.html, /about.html if ( segments . length === 2 ) return 'root' ; else //e.g /pages/about where segments are ['','pages','about'] //and the controller of course is always the second segment. return segments [ 1 ] ; } catch ( err ) { throw err ; } }
Gets the controller of the given url
@param {string|*} requestUri - A string that represents the url we want to parse.
@private
Gets the controller of the given url