1.0.5 • Published 2 years ago

fastify-impressions v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

fastify-impressions

fastify-impressions

Plugin to track impressions based on route(s)

Install

npm i fastify-impressions

Usage

const fastify = require("fastify")({ logging: false });
const fastifyImpressions = require("fastify-impressions");

fastify
  .register("fastifyImpressions", {
    blacklist: [], // specify URL's that are not to be tracked
    trackSuccessOnly: false // track only success responses
  })
  .catch(console.error);

fastify.listen(8080, (err, address) => {
  console.debug("Server started at:", address);
});

To see the impressions of the respective routes, access the /fastify-impressions, and this should return a JSON response

Plugin Options

  • blacklist <Array>
    • A list of URL's that should not be tracked
  • trackSuccessOnly <Boolean>
    • Enable this flag to track success responses only (200 series)

License

Licensed under ISC