stat-express
v1.0.1
Published
A nice request logging middleware similar to express-logging. Comes with request stats, request logs, and configurable path blocking.
Downloads
12
Maintainers
Readme
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');
});