Return text from Kibana server plugin

When I try to return plain text from the reply callback, it doesn't seem to work - it just hangs. Does anybody have any ideas as to why?

export default function (server) {

  server.route({
    path: '/metrics',
    method: 'GET',
    handler(req, reply) {
      return 'ok'
    }
  });
}

When I return reply("text") it returns "text" surrounded in html tags

so after a bit of playing about, it helps to have both type and encoding chained to the function

reply(thing).type('text/plain').encoding('binary')

Hope that hopes anyone looking for the same solution.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.