node-static icon indicating copy to clipboard operation
node-static copied to clipboard

Starting file server on Windows port 22 does not throw error

Open shakthimaan opened this issue 9 years ago • 0 comments

I am trying the following code snippet on Windows 7 using Node.js v6.2.0. The code works when using port 8080, but, when starting with port 22, it does not throw any error. Is there a way to catch it?

var static = require('node-static');

var file = new static.Server('public');

require('http').createServer(function (request, response) {
    request.addListener('end', function () {
        file.serve(request, response, function (err, result) {
            if (err) { 
                console.error("Error: " + err.message);
            }
        });
    }).resume();
}).listen(22);

shakthimaan avatar Aug 04 '16 09:08 shakthimaan