Add examples
Showing
4 changed files
with
52 additions
and
1 deletions
... | @@ -10,6 +10,13 @@ Simple, self-hosted module based on Socket.io and Chart.js to report realtime se | ... | @@ -10,6 +10,13 @@ Simple, self-hosted module based on Socket.io and Chart.js to report realtime se |
10 | `app.use(require('express-status-monitor')());` | 10 | `app.use(require('express-status-monitor')());` |
11 | 3. Run server and go to `/status` | 11 | 3. Run server and go to `/status` |
12 | 12 | ||
13 | ## Run examples | ||
14 | |||
15 | 1. Go to `examples/` | ||
16 | 2. Run `npm install` | ||
17 | 3. Run server `node index.js` | ||
18 | 4. Go to `http://0.0.0.0:3000` | ||
19 | |||
13 | ## Options | 20 | ## Options |
14 | 21 | ||
15 | Monitor can be configured by passing options object into `expressMonitor` constructor. | 22 | Monitor can be configured by passing options object into `expressMonitor` constructor. | ... | ... |
examples/index.js
0 → 100644
1 | const express = require('express'); | ||
2 | const app = express(); | ||
3 | |||
4 | const config = { | ||
5 | path: '/', | ||
6 | title: 'Express Status', | ||
7 | spans: [{ | ||
8 | interval: 1, | ||
9 | retention: 60 | ||
10 | }, { | ||
11 | interval: 5, | ||
12 | retention: 60 | ||
13 | }, { | ||
14 | interval: 15, | ||
15 | retention: 60 | ||
16 | }] | ||
17 | } | ||
18 | |||
19 | app.use(require('../index')(config)); | ||
20 | |||
21 | app.listen(3000, () => { | ||
22 | console.log('🌏 http://0.0.0.0:3000'); | ||
23 | }); |
examples/package.json
0 → 100644
1 | { | ||
2 | "name": "express-status-monitor-example", | ||
3 | "version": "0.0.1", | ||
4 | "description": "Examples", | ||
5 | "main": "index.js", | ||
6 | "author": "Rafal Wilinski raf.wilinski@gmail.com", | ||
7 | "contributors": [ | ||
8 | { | ||
9 | "name": "Julien Breux", | ||
10 | "email": "julien.breux@gmail.com", | ||
11 | "url": "https://github.com/JulienBreux/" | ||
12 | } | ||
13 | ], | ||
14 | "license": "MIT", | ||
15 | "dependencies": { | ||
16 | "express": "^4.14.0", | ||
17 | "on-headers": "^1.0.1", | ||
18 | "pidusage": "^1.0.4", | ||
19 | "socket.io": "^1.4.8" | ||
20 | } | ||
21 | } |
-
Please register or sign in to post a comment