Skip to content

Commit

Permalink
err check
Browse files Browse the repository at this point in the history
  • Loading branch information
ericz committed Mar 8, 2011
1 parent 1026ae8 commit 1cf30fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server.js
@@ -1,9 +1,11 @@
var fs = require('fs');
var server = require('http').createServer(function(req, response){
fs.readFile('.'+ req.url, function(err, data){
response.writeHead(200);
response.write(data);
response.end();
if(!err) {
response.writeHead(200);
response.write(data);
response.end();
}
});
});
server.listen(8080);
Expand Down

0 comments on commit 1cf30fc

Please sign in to comment.