Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jabis Sevón
/
esm
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
10bbaf56
authored
2016-08-19 12:47:14 +0200
by
Julien Breux
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add examples
1 parent
e1a7b66c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
3 deletions
.gitignore
README.md
examples/index.js
examples/package.json
.gitignore
View file @
10bbaf5
index.rendered.html
/node_modules/
\ No newline at end of file
node_modules
...
...
README.md
View file @
10bbaf5
...
...
@@ -6,14 +6,21 @@ Simple, self-hosted module based on Socket.io and Chart.js to report realtime se
## Installation & setup
1.
Run
`npm install express-status-monitor --save`
2.
Before any other middleware or router add following line:
2.
Before any other middleware or router add following line:
`app.use(require('express-status-monitor')());`
3.
Run server and go to
`/status`
## Run examples
1.
Go to
`examples/`
2.
Run
`npm install`
3.
Run server
`node index.js`
4.
Go to
`http://0.0.0.0:3000`
## Options
Monitor can be configured by passing options object into
`expressMonitor`
constructor.
Default config:
```
path: '/status',
...
...
examples/index.js
0 → 100644
View file @
10bbaf5
const
express
=
require
(
'express'
);
const
app
=
express
();
const
config
=
{
path
:
'/'
,
title
:
'Express Status'
,
spans
:
[{
interval
:
1
,
retention
:
60
},
{
interval
:
5
,
retention
:
60
},
{
interval
:
15
,
retention
:
60
}]
}
app
.
use
(
require
(
'../index'
)(
config
));
app
.
listen
(
3000
,
()
=>
{
console
.
log
(
'🌏 http://0.0.0.0:3000'
);
});
examples/package.json
0 → 100644
View file @
10bbaf5
{
"name"
:
"express-status-monitor-example"
,
"version"
:
"0.0.1"
,
"description"
:
"Examples"
,
"main"
:
"index.js"
,
"author"
:
"Rafal Wilinski raf.wilinski@gmail.com"
,
"contributors"
:
[
{
"name"
:
"Julien Breux"
,
"email"
:
"julien.breux@gmail.com"
,
"url"
:
"https://github.com/JulienBreux/"
}
],
"license"
:
"MIT"
,
"dependencies"
:
{
"express"
:
"^4.14.0"
,
"on-headers"
:
"^1.0.1"
,
"pidusage"
:
"^1.0.4"
,
"socket.io"
:
"^1.4.8"
}
}
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment