Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replacing sys.puts / error to console.log / error.

The "sys" module is now called "util" and it is not really necessary in this example.
  • Loading branch information...
commit af917a9d096de80f41b54e600c6c3811c42af8f5 1 parent b184ea4
@phstc phstc authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 examples/file-server.js
View
7 examples/file-server.js
@@ -1,4 +1,3 @@
-var sys = require('sys');
var static = require('../lib/node-static');
//
@@ -13,14 +12,14 @@ require('http').createServer(function (request, response) {
//
file.serve(request, response, function (err, res) {
if (err) { // An error as occured
- sys.error("> Error serving " + request.url + " - " + err.message);
+ console.error("> Error serving " + request.url + " - " + err.message);
response.writeHead(err.status, err.headers);
response.end();
} else { // The file was served successfully
- sys.puts("> " + request.url + " - " + res.message);
+ console.log("> " + request.url + " - " + res.message);
}
});
});
}).listen(8080);
-sys.puts("> node-static is listening on http://127.0.0.1:8080");
+console.log("> node-static is listening on http://127.0.0.1:8080");
Please sign in to comment.
Something went wrong with that request. Please try again.