1.3.3 • Published 7 years ago

loginportal v1.3.3

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

loginportal

loginportal-Banner

A nodejs express compatible middleware showing a portal, for restricted login access. This module allows people to follow you through, your development while keeping others from seeing the site. It provides you a login portal, that provided restricted access to the page.

How To

	npm install loginportal

Create a file called users.js in the root of loginportal.

Note: loginportal does not come with any default, so it would raise any error, if not created before use.
module.exports = [
		{"username": "subomi", "password": "fineboy"},
]

The users.js file exports an array of users containing their username and password.

Expressjs Example

var express = require('express');
var portal = require('loginPortal')();

var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser')();

var app = express();


app.use(cookieParser);
app.use(bodyParser.urlencoded());
app.use(portal);
app.post("/", function(request, response) {
	response.end("Glory to God");
});

app.listen(8080);

NOTES TO USAGE

  • The portal route is the route that restricts access.
  • It must be behind cookieParser and bodyParser.urlencoded in that order.
  • Those modules are dependencies, but are not internally used as they are general modules used in nodejs express development.

LICENSE

MIT

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago