0.0.9 • Published 5 years ago
@jebaraj.shenll/node-security v0.0.9
node-security
This library provides router and authentication middleware to register , authenticate and manage the user for a typical website.
Installation
npm i @jebaraj.shenll/node-securityUsage
// Set public RSA key
process.env.JWT_PUBLIC_KEY
var security = require('@jebaraj.shenll/node-security');
app.use('/users', security.userRoute);Endpoints
Login
POST /users/login
Content-Type: application/json
{"username":"username","password":"password"}List users
GET /usersRegister
POST /users
Content-Type: application/json
{"username":"username","password":"password"}