Node.js: How to track usage of my API?

My application as an API, with which I do not control. I don’t know which users use it, how many times, etc.

What is the best way to make an analytics system track my API usage?

Thank!

+3
source share
2 answers

Install a fast database such as Redis, and then start simple query tracking. Improve it.

+3
source

You can use harmony proxies to wrap all your API objects in order to track general characteristics by creating a general-purpose proxy that intercepts function calls and redirects them to your actual api after recording the information you need.

https://github.com/isaacs/node-proxy/

http://wiki.ecmascript.org/doku.php?id=harmony:proxies

+2
source

All Articles