Node.js Github API basic user output through server to webpage

I am new and trying github API. I tried this example which basically logs user information to the console. I, however, want it to be returned as a response from a server that is being run through node. Given below is the code:

"use strict";
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
 // res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');

var Client = require("github");

var github = new Client({
    debug: true,
    version: "3.0.0"
});

github.authenticate({
    type: "basic",
    username: "user",
    password: "password"
});

github.user.get({}, function(err, res) {
    console.log("GOT ERR?", err);
    console.log("GOT RES?", res);

    github.repos.getAll({}, function(err, res) {
        console.log("GOT ERR?", err);

        console.log("GOT RES?", res);

    });
});

How can it be done?