<commit_before>Api = {
  
  url: Meteor.settings && Meteor.settings.public && Meteor.settings.public.API_URL,
  
  indexOverrideUrl: Meteor.settings && Meteor.settings.public && Meteor.settings.public.INDEX_OVERRIDE_URL,
  appOverrideUrl: Meteor.settings && Meteor.settings.public && Meteor.settings.public.APP_OVERRIDE_URL,
  imageOverrideUrl: Meteor.settings && Meteor.settings.public && Meteor.settings.public.IMAGE_OVERRIDE_URL,
  packageOverrideUrl: Meteor.settings && Meteor.settings.public && Meteor.settings.public.PACKAGE_OVERRIDE_URL,
  
  getIndex: function(cb) {
    $.ajax({
      method: 'GET',
      url: this.indexOverrideUrl || [this.url, 'apps', 'index'].join('/'),
      cache: false,
      dataType: 'json',
      success: function(data) {
        return cb(null, data);
      },
      error: function(err) {
        return cb(err, null);
      }
    });
  },
  
  getApp: function(appId, cb) {
    $.ajax({
      method: 'GET',
      url: this.appOverrideUrl || [this.url, 'apps', appId].join('/'),
      cache: false,
      dataType: 'json',
      success: function(data) {
        return cb(null, data);
      },
      error: function(err) {
        return cb(err, null);
      }
    });
  },
  
  imageUrl: function(imageId) {
    return this.imageOverrideUrl || [this.url, 'images', imageId].join('/');
  },
  
  packageUrl: function(packageId) {
    return this.packageOverrideUrl || [this.url, 'packages', packageId].join('/');  
  }
  
};

Template.registerHelper('imageUrl', function(imageId) {
  return Api.imageUrl(imageId);<commit_msg>Add .json extension to app index JSON blobs.<commit_after>Api = {
  
  url: Meteor.settings && Meteor.settings.public && Meteor.settings.public.API_URL,
  
  indexOverrideUrl: Meteor.settings && Meteor.settings.public && Meteor.settings.public.INDEX_OVERRIDE_URL,
  appOverrideUrl: Meteor.settings && Meteor.settings.public && Meteor.settings.public.APP_OVERRIDE_URL,
  imageOverrideUrl: Meteor.settings && Meteor.settings.public && Meteor.settings.public.IMAGE_OVERRIDE_URL,
  packageOverrideUrl: Meteor.settings && Meteor.settings.public && Meteor.settings.public.PACKAGE_OVERRIDE_URL,
  
  getIndex: function(cb) {
    $.ajax({
      method: 'GET',
      url: this.indexOverrideUrl || [this.url, 'apps', 'index.json'].join('/'),
      cache: false,
      dataType: 'json',
      success: function(data) {
        return cb(null, data);
      },
      error: function(err) {
        return cb(err, null);
      }
    });
  },
  
  getApp: function(appId, cb) {
    $.ajax({
      method: 'GET',
      url: this.appOverrideUrl || [this.url, 'apps', appId + '.json'].join('/'),
      cache: false,
      dataType: 'json',
      success: function(data) {
        return cb(null, data);
      },
      error: function(err) {
        return cb(err, null);
      }
    });
  },
  
  imageUrl: function(imageId) {
    return this.imageOverrideUrl || [this.url, 'images', imageId].join('/');
  },
  
  packageUrl: function(packageId) {
    return this.packageOverrideUrl || [this.url, 'packages', packageId].join('/');  
  }
  
};

Template.registerHelper('imageUrl', function(imageId) {
  return Api.imageUrl(imageId);
{'fraction_non_alphanumeric': 0.15754716981132075, 'fraction_numerical': 0.0, 'mean_word_length': 3.1419270833333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4080330', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1032, 'n_words': 183}