var Hapi = require('hapi');
var S = require('string');

var server = new Hapi.Server('localhost', 8000);

server.route({
    method: 'GET',
    path: '/hello',
    handler: function (request, reply) {
        reply(JSON.stringify({
           'message': 'Hello'
        }));
    }
});

server.route({
    method: 'GET',
    path: '/hello/{name}',
    handler: function (request, reply) {
        reply(JSON.stringify({
           'message': 'Hello ' + S(request.params.name).capitalize()
        }));
    }
});

server.start();

@@ -258,32 +258,57 @@
 llo'%0A        %7D))
+.type('application/json')
 ;%0A    %7D%0A%7D);%0A%0Aser
@@ -517,16 +517,41 @@
      %7D))
+.type('application/json')
 ;%0A    %7D%0A

Set response content type to application/json in hapijs example