Skip to content

Commit

Permalink
Added index.js, which is literally hardcoded to list my projects.
Browse files Browse the repository at this point in the history
Edited README.md to include a link to the blog.
  • Loading branch information
abe545 committed Mar 11, 2014
1 parent b4de1a2 commit a9c7cfc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ codeplex-for-strider
====================

A codeplex provider for strider-cd
This is an ongoing project, that I am using as a way to learn node.

If, for some strange reason you want to follow along, you can follow the progress at http://gettinggui.com
37 changes: 37 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var https = require('https');
var http = require('http');


http.createServer(function(request, response) {
console.log("Request handler 'codeplex' was called.");

var options = {
hostname: 'www.codeplex.com',
path: '/api/users/aheidebrecht/projects',
method: 'GET'
};

var req = https.request(options, function(res) {
var json = '';
res.on('data', function(d) {
json += d;
});

res.on('end', function() {
var str = JSON.stringify(JSON.parse(json), null, " ");
response.writeHead(200, { 'Content-Type': 'text/plain' });
response.write(str);
response.end();
});
});

req.end();

req.on('error', function(err) {
console.error(err);

response.writeHead(500, { 'Content-Type': 'text/plain' });
response.write(err);
response.end();
});
}).listen(999);

0 comments on commit a9c7cfc

Please sign in to comment.