An error occurred while loading the file. Please try again.
-
Wolfgang Knopki authored
This reverts commit f83b6c2a, reversing changes made to c2b73ce6.
08d3a3ba
var http = require("http");
var auth = require("http-auth");
var basic = auth.basic({
authRealm: "Private area",
authFile: __dirname + "/htpasswd",
authType: "basic"
});
var server = http.createServer(function(request, response) {
basic.apply(request, response, function(username) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello " + username);
response.end();
});
});
server.listen(80);
console.log("Server is listening");