title: Hapi - reply JSON only
body: <p>How can I adjust the Hapi reply function such that it would reply JSON objects only?
  Should I send it as plain and send? I seem not to find a good example </p>
  
  <p>Here is some edit - added some sample code to understand what's happening.</p>
  
  <p>The route:</p>
  
  <pre><code>server.route({
      method: 'GET',
      path: '/user/',
      handler: function (request, reply) {
  
          var ids = null;
  
          mysqlConnection.query('SELECT ID FROM Users;',function(err,rows,fields){
              if(err) throw err;
              ids = rows;
              // console.log(ids);
              reply(ids);
          });    
      }
  });
  </code></pre>
  
  <p>The reply:</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;
  &lt;pre style="word-wrap: break-word; white-space: pre-wrap;"&gt;[{"ID":1},{"ID":2},{"ID":3},{"ID":4},{"ID":5},{"ID":6},{"ID":7},{"ID":8},{"ID":9},{"ID":10},{"ID":11},{"ID":12},{"ID":13},{"ID":14},{"ID":15},{"ID":16},{"ID":17},{"ID":18},{"ID":19},{"ID":20},{"ID":21}]
  &lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>