Speed up development with full-stack environments for every branch.

Learn More

mockable NodeJS [Node.js and Hello World]

Forked from Hello World for Node.js.

42 Runs 36 Views 87 Copies

Hello world in Node.js

Saved

Saved

danpillay87 3

danpillay87
published 13 days ago

    function getSalesData() {
    var https = require('https');
    var url = 'https://demo6357459.mockable.io/googlehome/action/';
    
    https.get(url, function(res){
        var body = '';
    
        res.on('data', function(chunk){
            body += chunk;
        });
    
        res.on('end', function(){
            var apiResponse = JSON.parse(body);
            var leads = apiResponse.leads;
        });
    }).on('error', function(e){
          console.log("Got an error: ", e);
    });
    console.log(leads)
    }
    Please login/signup to get access to the terminal.

    Your session has timed out.

    Dismiss (the page may not function properly).