Wednesday 7 June 2017

Looking to grab data from an API and have it build a table using Node/Express

I'm looking to build a crypto price web app like www.coincap.io or www.coinmarketcap.com ; I initially started hard coding with EJS and then realized this would take forever.

This is the code I have thus far, and I'm wondering what I should throw into the forEach loop to have my javascript build a table for me as it receives results. Any ideas?

app.get("/", function(req, res){
    request("https://api.coinmarketcap.com/v1/ticker/?limit=100", function(error, response, body){
        if(!error && response.statusCode == 200){
            var data = JSON.parse(body);
            data.forEach(function(prices){

            })      
            res.render("index", {data: data});
        }
    });
});



via loop13side7

No comments:

Post a Comment