-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
65 lines (55 loc) · 1.32 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const express = require("express");
const app = express();
const os = require("os");
const pretty = require("json-pretty-html").default;
app.get("/", function(req, res) {
var nodeInfo = {
hostname: os.hostname(),
type: os.type(),
platform: os.platform(),
arch: os.arch(),
release: os.release()
};
res.send(`<html>
<body>
<style>
body {
font-family: Menlo, Monaco, "Courier New", monospace;
background-color: #24282A;
color: #d4d4d4;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.json-pretty {
padding: 30px;
border: solid 1px white;
}
.json-selected {
background-color: rgba(139, 191, 228, 0.19999999999999996);
}
.json-string {
color: #6caedd;
}
.json-key {
color: #ec5f67;
}
.json-boolean {
color: #99c794;
}
.json-number {
color: #99c794;
}
</style>
<h4>Armada - node info</h4>
<div class="container">
${pretty(nodeInfo)}
</div>
</body>
</html>`);
});
app.listen(3000, function() {
console.log("App listening on port 3000!");
});