1.5.0 • Published 2 years ago
@apilytics/express v1.5.0
@apilytics/express
Apilytics is a service that lets you analyze operational, performance and security metrics from your APIs easily.
Installation
Sign up and get your API key from https://apilytics.io - we offer a completely free trial with no credit card required!
Install this package:
yarn add @apilytics/express
# OR
npm install @apilytics/express
- Enable the middleware and set your API key:\
A good practice is to securely store the API key as an environment variable.
You can leave the env variable unset in e.g. development and test environments,
the middleware will be automatically disabled if the key is
undefined
.
server.js
:
const { apilyticsMiddleware } = require('@apilytics/express');
const express = require('express');
const app = express();
// Ideally the first middleware you add.
app.use(apilyticsMiddleware(process.env.APILYTICS_API_KEY));
Frequently Asked Questions
Does the middleware slow down my backend?
- No. The middleware does all of its requests to the Apilytics API in the background, by using promises without awaiting them, so it will not slow down your normal request handling.
What 3rd party dependencies does @apilytics/express
have?
- None besides Express itself.
What Node.js versions does the package work with?
@apilytics/express
is tested to work on all the currently supported versions of Node: 12, 14, 16, and 17.