New:Socket for Asana Is Now Available.Learn more
Sign In

loginportal

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loginportal

A nodejs middleware showing a portal, for restricted login access

latest
Source
npmnpm
Version
1.3.3
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

portal

FAQs

Package last updated on 21 Nov 2016

Related posts