lib/helpers.js
function(path, secure) {
      var root = app.get('static url').replace(/.*:\/\//, '');
      var proto = 'http';

      if (path && path[0] === '/') {
        path = path.slice(1);
      }

      if (secure) {
        root =
          undefsafe(config, 'url.ssl.static') ||
          undefsafe(config, 'url.static') ||
          undefsafe(config, 'url.host');
        proto = 'https';
      }

      return path
        ? proto + '://' + root + '/' + (path || '')
        : proto + '://' + root;
    }
function(path, secure) {
      var root = app.get('static url').replace(/.*:\/\//, '');
      var proto = 'http';

      if (path && path[0] === '/') {
        path = path.slice(1);
      }

      if (secure) {
        root =
          undefsafe(config, 'url.ssl.static') ||
          undefsafe(config, 'url.static') ||
          undefsafe(config, 'url.host');
        proto = 'https';
      }

      return path
        ? proto + '://' + root + '/' + (path || '')
        : proto + '://' + root;
    }
function ( path , secure ) { var root = app . get ( 'static url' ) . replace ( / .*:\/\/ / , '' ) ; var proto = 'http' ; if ( path && path [ 0 ] === '/' ) { path = path . slice ( 1 ) ; } if ( secure ) { root = undefsafe ( config , 'url.ssl.static' ) || undefsafe ( config , 'url.static' ) || undefsafe ( config , 'url.host' ) ; proto = 'https' ; } return path ? proto + '://' + root + '/' + ( path || '' ) : proto + '://' + root ; }
Returns a url for a static resource.
Returns a url for a static resource .