1.0.14 • Published 2 years ago

foxyiti-api-monitoring-node-express v1.0.14

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

Foxyiti API Monitoring -> NodeJS | Express


Installation

yarn

$ yarn add foxyiti-api-monitoring-node-express

npm

$ npm i foxyiti-api-monitoring-node-express --save

In NodeJS

# import package
const { middleware } = require('foxyiti-api-monitoring-node-express');

# apply as express middleware to monitor all API
app.use(middleware());
# import package
const { middleware } = require('foxyiti-api-monitoring-node-express');

# Add middleware in specific APIs which has to be monitored
app.get('/', middleware(), (req, res) => {
    ...
    ...
});

app.post('/', middleware(), (req, res) => {
    ...
    ...
});

# This particular API will not be monitored
app.delete('/', (req, res) => {
    ...
    ...
});

Options

Options are not mandatory.

OptionsMandatoryDefaultValues
excludeFALSE{}{ GET: [], POST: [], PATCH: [], DELETE: [], }

Exclude

  • Excludes the given API path's for each method. These API are not monitored.
  • You can use express way of applying/ not applying global middleware to specific routes.
# import package
const { middleware } = require('foxyiti-api-monitoring-node-express');

const options = {
    exclude: {
        GET: ['/', '/health'],
    }
};

# '/' and '/health' APIs of GET method are not monitored
app.use(middleware(options));
1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago