lib/web/urls.js
function resolveApp(baseAliasOrNameOrApp, options) {
    if (options === void 0) { options = {}; }
    // defaults on arguments given
    var url;
    if (!baseAliasOrNameOrApp) {
        url = options.application || init.initOptions.application;
    }
    else if (_.isString(baseAliasOrNameOrApp)) {
        url = baseAliasOrNameOrApp;
    }
    else {
        url = baseAliasOrNameOrApp.baseAlias || baseAliasOrNameOrApp.name;
    }
    // application must not include the leading slash for resolveUrl to do the job
    url = url.replace(/\/?(.*)/, '$1');
    // resolve local path against application
    return resolveUrl('.', _.defaults({
        application: url
    }, options));
}
function resolveApp(baseAliasOrNameOrApp, options) {
    if (options === void 0) { options = {}; }
    // defaults on arguments given
    var url;
    if (!baseAliasOrNameOrApp) {
        url = options.application || init.initOptions.application;
    }
    else if (_.isString(baseAliasOrNameOrApp)) {
        url = baseAliasOrNameOrApp;
    }
    else {
        url = baseAliasOrNameOrApp.baseAlias || baseAliasOrNameOrApp.name;
    }
    // application must not include the leading slash for resolveUrl to do the job
    url = url.replace(/\/?(.*)/, '$1');
    // resolve local path against application
    return resolveUrl('.', _.defaults({
        application: url
    }, options));
}
function resolveApp ( baseAliasOrNameOrApp , options ) { if ( options === void 0 ) { options = { } ; } // defaults on arguments given var url ; if ( ! baseAliasOrNameOrApp ) { url = options . application || init . initOptions . application ; } else if ( _ . isString ( baseAliasOrNameOrApp ) ) { url = baseAliasOrNameOrApp ; } else { url = baseAliasOrNameOrApp . baseAlias || baseAliasOrNameOrApp . name ; } // application must not include the leading slash for resolveUrl to do the job url = url . replace ( / \/?(.*) / , '$1' ) ; // resolve local path against application return resolveUrl ( '.' , _ . defaults ( { application : url } , options ) ) ; }
computes the basepath of a BaaS application.

@param baseAliasOrNameOrApp baseAlias of application, may be name when baseAlias is not changed
by developer or application metadata object of Relution server.
@param options of server in effect.
@return {string} absolute URL of application alias on current server.
computes the basepath of a BaaS application .