stat-express

1.0.1 • Public • Published

1.0.1 - Stat-Express

A nice request logging middleware similar to express-logging. Comes with request stats, request logs, and configurable path blocking.s

Middleware Options

The middleware object allows you to configure the logging options.

ipLog : Includes Client IP In The Log ( True | False )

blockedPaths : ( Blocks certain paths from being logged )

Usage

Here's how you can use the stat-express middleware in your Express.js application:

const express = require('express');
const { stat_express } = require('stat-express');

const app = express();

const middlewareOptions = {
  logIP: true 
  //blockedPaths: ['/blocked'] 
};

app.use(stat_express(middlewareOptions));

app.get('/', (req, res) => {
  res.status(200).send('Hello World');
});

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

Package Sidebar

Install

npm i stat-express

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

4.07 kB

Total Files

4

Last publish

Collaborators

  • amysox.