<commit_before>'use strict';

var _ = require('lodash');
var cacheTimes = require('../web/config/cache-times');
var fs = require('fs');
var defaultImage = new Buffer(fs.readFileSync(__dirname + '/../web/public/img/avatar.png', 'base64'), 'base64');

exports.register = function (server, options, next) {
  options = _.extend({ basePath: '/api/2.0' }, options);
  var handlers = require('./handlers.js')(server, 'cd-profiles');

  server.route([{
    method: 'POST',
    path: options.basePath + '/profiles/user-profile-data',
    handler: handlers.actHandler('user_profile_data')
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/create',
    handler: handlers.actHandlerNeedsUser('create')
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/youth/create',
    handler: handlers.actHandlerNeedsUser('save-youth-profile')
  }, {
    method: 'PUT',
    path: options.basePath + '/profiles/youth/update',
    handler: handlers.actHandlerNeedsUser('update-youth-profile')
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/invite-parent-guardian',
    handler: handlers.actHandlerNeedsUser('invite-parent-guardian')
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/accept-parent-guardian',
    handler: handlers.actHandlerNeedsUser('accept-parent-invite')
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/hidden-fields',
    handler: handlers.actHandler('load_hidden_fields'),
    config: {
      cache: {
        expiresIn: cacheTimes.long
      }
    }
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/change-avatar',
    handler: handlers.actHandlerNeedsUser('change_avatar')
  }, {
    method: 'GET',
    path: options.basePath + '/profiles/{id}/avatar',
    handler: handlers.actHandler('get_avatar', 'id')
  }, {
    method: 'GET',
    path: options.basePath + '/profiles/{id}/avatar_img',
    handler: handleAvatarImage
  }, {
    method: 'GET',
    path: options.basePath + '/profiles/parents-for-user/{userId}',
    handler: handlers.actHandler('load_parents_for_user', 'userId')
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/invite-ninja',<commit_msg>Corrected /profiles/hidden-fields<commit_after>'use strict';

var _ = require('lodash');
var cacheTimes = require('../web/config/cache-times');
var fs = require('fs');
var defaultImage = new Buffer(fs.readFileSync(__dirname + '/../web/public/img/avatar.png', 'base64'), 'base64');

exports.register = function (server, options, next) {
  options = _.extend({ basePath: '/api/2.0' }, options);
  var handlers = require('./handlers.js')(server, 'cd-profiles');

  server.route([{
    method: 'POST',
    path: options.basePath + '/profiles/user-profile-data',
    handler: handlers.actHandler('user_profile_data')
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/create',
    handler: handlers.actHandlerNeedsUser('create')
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/youth/create',
    handler: handlers.actHandlerNeedsUser('save-youth-profile')
  }, {
    method: 'PUT',
    path: options.basePath + '/profiles/youth/update',
    handler: handlers.actHandlerNeedsUser('update-youth-profile')
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/invite-parent-guardian',
    handler: handlers.actHandlerNeedsUser('invite-parent-guardian')
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/accept-parent-guardian',
    handler: handlers.actHandlerNeedsUser('accept-parent-invite')
  }, {
    method: 'GET',
    path: options.basePath + '/profiles/hidden-fields',
    handler: handlers.actHandler('load_hidden_fields'),
    config: {
      cache: {
        expiresIn: cacheTimes.long
      }
    }
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/change-avatar',
    handler: handlers.actHandlerNeedsUser('change_avatar')
  }, {
    method: 'GET',
    path: options.basePath + '/profiles/{id}/avatar',
    handler: handlers.actHandler('get_avatar', 'id')
  }, {
    method: 'GET',
    path: options.basePath + '/profiles/{id}/avatar_img',
    handler: handleAvatarImage
  }, {
    method: 'GET',
    path: options.basePath + '/profiles/parents-for-user/{userId}',
    handler: handlers.actHandler('load_parents_for_user', 'userId')
  }, {
    method: 'POST',
    path: options.basePath + '/profiles/invite-ninja',
{'fraction_non_alphanumeric': 0.17279160009130334, 'fraction_numerical': 0.0027391006619493265, 'mean_word_length': 3.706766917293233, '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': '3573399', 'n_tokens_mistral': 1454, 'n_tokens_neox': 1426, 'n_words': 240}