details info query working

This commit is contained in:
2022-12-09 00:44:10 +02:00
parent 7962e19205
commit a015f18db0
3 changed files with 61 additions and 5 deletions
+22 -1
View File
@@ -27,7 +27,7 @@ router.get('/coins/markets', function (req, res) {
})
router.get('/coins/count', function (req, res) {
router.get('/count', function (req, res) {
let url = config.coingecko.api_url + '/global';
// console.log("url: ", url);
@@ -41,4 +41,25 @@ router.get('/coins/count', function (req, res) {
})
})
router.get('/coin/:id', function (req, res) {
let id = req.params['id'];
let url = config.coingecko.api_url + '/coins/' + id;
console.log("id: ", id);
api_helper.REMOTE_API_call(url)
.then(response => {
res.json(response);
})
.catch(error => {
console.log("error: ", error);
res.send(error);
})
})
module.exports = router;