1.0.2 • Published 2 years ago
restapi_dashboard v1.0.2
Development in progress
The development of this project is ongoing, new vertions are published every day.
Self-host your own monitoring dashboard for your RestAPI based on Express. Get request statistics and track the status of your server in real time.
Installation & setup
- Run
npm i restapi_dashboard --save
- Add the line before all other middleware:
const express = require("express");
const app = express();
// Add this line before all other middleware
app.use(require('restapi_dashboard')());
app.listen(80, () => {
console.log(`Express server is running : http://localhost/`);
});
Note: This plugin works on Node versions > 4.x
Configuration
You can change the configuration:
const config = {
path: '/custom',
ignorePaths: [ '/staff' ],
}
app.use(require('restapi_dashboard')(config));
Default config:
path: '/restapiDashboard',
ignorePaths: [ '/public', '/favicon.ico', '/admin' ],
recoveredData: {
cpu: true,
memory: true,
load: true,
eventLoop: true,
heap: true,
responseTime: true,
totalRequests: true,
httpStatusCodes: true,
requestedRoutes: true
}
Recovered Data:
totalRequests
: Total number of requests received by the service per secondehttpStatus
: Monitor the status of request responsesrequestedRoutes
: Monitor the number of times each route has been called up