A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/gevorg/http-auth below:

gevorg/http-auth: Node.js package for HTTP basic and digest access authentication.

Node.js package for HTTP basic and digest access authentication.

Via git (or downloaded tarball):

$ git clone git@github.com:gevorg/http-auth.git

Via npm:

// HTTP module
const http = require("http");

// Authentication module.
const auth = require("http-auth");
const basic = auth.basic({
  realm: "Simon Area.",
  file: __dirname + "/../data/users.htpasswd" // gevorg:gpass, Sarah:testpass
});

// Creating new HTTP server.
http
  .createServer(
    basic.check((req, res) => {
      res.end(`Welcome to private area - ${req.user}!`);
    })
  )
  .listen(1337, () => {
    // Log URL.
    console.log("Server running at http://127.0.0.1:1337/");
  });

Please check examples directory for more.

It uses mocha, so just run following command in package directory:

You can also use stackoverflow to ask questions using http-auth tag.

Please check this link for integration packages.

The MIT License (MIT)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4