Skip to content

Commit 62b637c

Browse files
committed
put home route
1 parent 3d5f499 commit 62b637c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ collectDefaultMetrics({
1010

1111
const app = express();
1212

13+
app.get('/', (req, res) => {
14+
res.set('Content-Type', 'text/html');
15+
res.send([
16+
'<html>',
17+
'<head><title>NodeJS Prom Exporter</title></head>',
18+
'<body>',
19+
'<h1>NodeJS Prom Exporter</h1>',
20+
'<p><a href="/metrics">Metrics</a></p>',
21+
'</body>',
22+
'</html>'
23+
].join('\n'));
24+
})
25+
1326
app.get('/metrics', async (_req, res) => {
1427
try {
1528
res.set('Content-Type', register.contentType);

0 commit comments

Comments
 (0)