Kong / galileo-agent-node

Node.js agent for Galileo - API Analytics
https://getgalileo.io
MIT License
9 stars 4 forks source link

Hapi compatibility ? #22

Open jbpionnier opened 8 years ago

jbpionnier commented 8 years ago

Have you planned compatibility with Hapi? http://hapijs.com/

Thank's

ahmadnassri commented 8 years ago

@jbpionnier will look into adding it next.

jbpionnier commented 8 years ago

Ok, it's possible :

var analytics = require('mashape-analytics')
var agent = analytics('SERVICE_TOKEN')

server.ext('onRequest', function (request, reply) {
  agent(request.raw.req, request.raw.res)
  reply.continue()
})

but there is a bug with Hapi : the request is sent twice Issue in hapi : https://github.com/hapijs/hapi/issues/2966 Pull request : https://github.com/Mashape/analytics-agent-node/pull/23

thanks

ahmadnassri commented 8 years ago

thanks @jbpionnier