{"size": 655, "ext": "js", "max_stars_repo_path": "api/handlers/home.js", "max_stars_repo_name": "jeff0905/fews-api", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "api/handlers/home.js", "max_issues_repo_name": "jeff0905/fews-api", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "api/handlers/home.js", "max_forks_repo_name": "jeff0905/fews-api", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.3928571429, "max_line_length": 58, "alphanum_fraction": 0.5801526718}
module.exports.hello = {
  handler: function (request, reply) {
    
    // console.log(request.mysql.pool);
    const pool = request.mysql.pool;
    pool.query('select * from users', (err, result) => {
      if (err) {
        console.log(err);
        return reply('internal mysql error');
      }
      reply({result});
    })
    // return reply({ result: 'Hello hapi!' });
  }
};

module.exports.restricted = {
  auth: 'jwt',
  handler: function (request, reply) {
    return reply({ result: 'Restricted!' });
  }
};

module.exports.notFound = {
  handler: function (request, reply) {
    return reply({ result: 'Oops, 404 Page!' }).code(404);
  }
};