From within a middleware module, I'm trying to count the number of page requests made from the parent app. Think of it as a generic request monitor that knows nothing about the pages the parent serves. My initial stab at it simply listened for requests and incremented a counter with each response generated, only to find that each page request generated n number of additional responses from all of the included requests (favicon.ico, script files, etc). I expected that, but hoped there was a way to filter out the secondary files.
Is there a way to differentiate between them so that I can ignore the included files in my count?
So far, I've used the request and express-req-metrics middlewares to look at the response properties, but haven't yet seen any property that was helpful.