router.js 462 B

123456789
  1. Router.prototype.url = function() {
  2. // We need to remove the leading base path, or "/", as it will be inserted
  3. // automatically by `Meteor.absoluteUrl` as documented in:
  4. // http://docs.meteor.com/#/full/meteor_absoluteurl
  5. var completePath = this.path.apply(this, arguments);
  6. var basePath = this._basePath || '/';
  7. var pathWithoutBase = completePath.replace(new RegExp('^' + basePath + '\/|(\/)'), '');
  8. return Meteor.absoluteUrl(pathWithoutBase);
  9. };