1.3.0 • Published 8 years ago

express-req-tracker v1.3.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

express-req-tracker

Travis-CI NPM downloads

NPM package-info

A Express middleware for tracking request and responses.

Installation

yarn add express-req-tracker
# or
npm install -S express-req-tracker

Usage

import express from 'express';
import reqTracker from 'express-req-tracker';

const app = express();

// use req-tracker
app.use(reqTracker({
  app: 'my-project',
  mongodb: 'mongodb://localhost/req-tracker-sample',
  options: {
    immediate: true
  }
}));

app.get('/', (req, res) => {
  res.json('hello world');
});

const PORT = process.env.PORT;
app.listen(PORT, () => {
  console.log(`server is running at: http://localhost:${PORT}`);
});

Run Example

Notice: before run example, please ensure you have installed and running MongoDB.

# first: run unit test to produce request logs
npm run test

# second: run sample
npm run start

after running example, then you can open the dashboard http://localhost:7001/req-tracker/dashboard to view the request logs.

npm.io

License

MIT

1.3.0

8 years ago

1.2.9

8 years ago

1.2.8

8 years ago

1.2.7

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago