0.0.5 • Published 5 years ago

e-statics v0.0.5

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

e-statics

NPM Version NPM Downloads

Module for express statics, returns

{
"GET": 0,
"POST": 0,
"PUT": 0,
"DELETE": 0,
"TOTAL": 0,
"LAST_MS": 0,
"AVG_MS": 0,
"MIN_MS": 0,
"MAX_MS": 0,
"TOTAL_MS": 0
}

Installation

npm install e-statics --save

Usage

e-statics adds automatically get route(/e-statics) to your routes.

const express = require("express");
const app = express();
const eStatics = require("e-statics")(app);
app.use(eStatics.counter);
app.get('/', (req, res) => res.send('Hello World!'))
app.listen(8080, () => console.log(`Example app listening on port ${port}!`))

If you dont want to use this route just dont add app to e-statics

const express = require("express");
const app = express();
const eStatics = require("e-statics")();
app.use(eStatics.counter);
app.get('/', (req, res) => res.send('Hello World!'))
app.get('/my-stats-route', (req, res) => res.send(eStatics.stats))
app.listen(8080, () => console.log(`Example app listening on port ${port}!`))
0.0.5

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago