<commit_before>'use strict';

var Mentat = require('mentat');

module.exports = new Mentat.Handler('Itemtypes', {
  routes: [
    { method: 'GET', path: '/api/itemtypes' }
  ],

  GET: function (request, reply) {
    var itemtypes = {
      book: 'Book',
      audiobook: 'Audiobook',
      downloadable_audio: 'Downloadable Audio',
      ebook: 'Ebook',
      largeprint: 'Large Print',
      music: 'Music',
      dvd: 'DVD',
      bluray: 'Blu-ray',
      periodical: 'Periodical',
      zine: 'Zine',
      database: 'Database',
      other: 'Other'
    };

    reply(itemtypes).code(200);
  }
});<commit_msg>moved itemtypes into settings.js<commit_after>'use strict';

var Mentat = require('mentat');
var _ = require('lodash');

module.exports = new Mentat.Handler('Itemtypes', {
  routes: [
    { method: 'GET', path: '/api/itemtypes' }
  ],

  GET: function (request, reply) {
    var itemtypes = _.get(Mentat.settings, 'ilsOptions.itemTypes', {
      error: 'Set ilsOptions.itemTypes in settings.js!'
    });

    reply(itemtypes).code(200);
  }
});
{'fraction_non_alphanumeric': 0.1684011352885525, 'fraction_numerical': 0.005676442762535478, 'mean_word_length': 3.1328125, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4810743', 'n_tokens_mistral': 371, 'n_tokens_neox': 357, 'n_words': 78}