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
b403d596
authored
2016-08-18 07:43:07 +0200
by
Rafal Wilinski
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add Manual HTTPS support
1 parent
cd5c09cb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
README.md
index.html
index.js
README.md
View file @
b403d59
...
...
@@ -16,7 +16,8 @@ Monitor can be configured by passing options object into `expressMonitor` constr
Default config:
```
path: '/status',
socketPort: 41338, // Port for Socket.io communication
socketPort: 41338, // Port for Socket.io communication,
useHttps: false, // Force HTTPS protocol instead of HTTP
spans: [{
interval: 1, // Every second
retention: 60 // Keep 60 datapoints in memory
...
...
index.html
View file @
b403d59
...
...
@@ -136,7 +136,7 @@
Chart
.
defaults
.
global
.
elements
.
line
.
borderColor
=
"rgba(0,0,0,0.9)"
;
Chart
.
defaults
.
global
.
elements
.
line
.
borderWidth
=
2
;
var
socket
=
io
(
window
.
location
.
protocol
+
'
//'
+
window
.
location
.
hostname
+
':{{port}}'
);
var
socket
=
io
(
'{{protocol}}'
+
':
//'
+
window
.
location
.
hostname
+
':{{port}}'
);
var
defaultSpan
=
0
;
var
spans
=
[];
...
...
index.js
View file @
b403d59
...
...
@@ -10,6 +10,7 @@
const
defaultConfig
=
{
socketPort
:
41338
,
path
:
'/status'
,
useHttps
:
false
,
spans
:
[{
interval
:
1
,
retention
:
60
...
...
@@ -85,7 +86,7 @@
fs
.
readFile
(
path
.
join
(
__dirname
,
'index.html'
),
'utf8'
,
(
err
,
data
)
=>
{
if
(
err
)
throw
new
Error
(
err
);
var
result
=
data
.
replace
(
/{{port}}/g
,
config
.
socketPort
);
var
result
=
data
.
replace
(
/{{port}}/g
,
config
.
socketPort
)
.
replace
(
/{{protocol}}/g
,
config
.
useHttps
?
'https'
:
'http'
)
;
fs
.
writeFile
(
path
.
join
(
__dirname
,
'index.rendered.html'
),
result
,
'utf8'
,
(
err
)
=>
{
if
(
err
)
throw
new
Error
(
err
);
...
...
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