Kong / galileo-agent-node

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

When using Express 4 and the Express Router, paths are improperly reported #10

Open nijikokun opened 9 years ago

nijikokun commented 9 years ago

Using the new Express 4.x feature of the Express Router (miniature instance of Express Application) paths are improperly reported to API Analytics.

index.js (Require routes)

app.use('/account', require('./routes/account'))

routes/account.js (Account Router)

var express = require('express');
var router;

module.exports = router = express.Router();

router.get('/:id', function (req, res, next) {
  console.log(req.query.id)
});

Fetching /accounts/2958926829234 would result in API Analytics displaying /2958926829234 instead of the correct path with the /accounts segment prepended.

hutchic commented 7 years ago

is this still relevant?

nijikokun commented 7 years ago

Yes @hutchic