Skip to content

Commit 104e718

Browse files
committed
Merge pull request #250 from apis-is/patch-metrics-endpoint
Metrics endpoints for #249
2 parents 461cd3e + bfa2437 commit 104e718

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

endpoints/metrics/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import axios from 'axios';
2+
import app from '../../server';
3+
4+
app.get('/metrics', (req,res,next) => {
5+
axios
6+
.get('http://localhost:8091/metrics')
7+
.then((response) => {
8+
res.json(response.data);
9+
})
10+
.catch( (error) => {
11+
res.status(500).json({ error: 'Could not query the data source' });
12+
});
13+
});

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
],
4343
"dependencies": {
4444
"apis-helpers": "0.0.1",
45+
"axios": "^0.9.1",
4546
"babel": "^5.8.29",
4647
"cheerio": "~0.12.4",
4748
"debug": "^2.2.0",

0 commit comments

Comments
 (0)