{"size": 593, "ext": "js", "max_stars_repo_path": "example/services/generator/index.js", "max_stars_repo_name": "delvedor/What-if-I-told-you-that-HTTP-can-be-fast", "max_stars_repo_stars_event_min_datetime": "2017-09-22T19:28:40.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-24T03:07:41.000Z", "max_issues_repo_path": "example/services/generator/index.js", "max_issues_repo_name": "delvedor/What-if-I-told-you-that-HTTP-can-be-fast", "max_issues_repo_issues_event_min_datetime": "2017-09-25T08:32:28.000Z", "max_issues_repo_issues_event_max_datetime": "2017-09-26T07:07:38.000Z", "max_forks_repo_path": "example/services/generator/index.js", "max_forks_repo_name": "delvedor/What-if-I-told-you-that-HTTP-can-be-fast", "max_forks_repo_forks_event_min_datetime": "2018-09-10T08:30:23.000Z", "max_forks_repo_forks_event_max_datetime": "2018-09-10T08:30:23.000Z"}
{"max_stars_count": 8, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 19.1290322581, "max_line_length": 57, "alphanum_fraction": 0.5463743676}
'use strict'

async function generator (fastify, opts) {
  fastify.register(require('point-of-view'), {
    engine: {
      handlebars: require('handlebars')
    },
    templates: __dirname
  })

  fastify.route({
    method: 'GET',
    url: '/',
    schema: {
      querystring: {
        type: 'object',
        properties: {
          text: { type: 'string' }
        },
        required: ['text']
      }
    },
    handler: function (req, reply) {
      reply.view('/index.html', { text: req.query.text })
    }
  })
}

module.exports = generator
module.exports.autoPrefix = '/generator'
