npm.io
1.0.2 • Published 8 years ago

express-authjs

Licence
MIT
Version
1.0.2
Deps
2
Size
6 kB
Vulns
3
Weekly
0
Stars
2

Express Auth Middleware

express-authjs is a simple to use express middleware that adds configurable authentication to your express API routes with as little affort as possible.

Table of Contents

Getting Started

The instructions below will help you get started using exress-authjs as quickly as possible.

Installing
npm install express-authjs
Basic Usage
const express = require('express');
const { Authenticator, guard } = require('express-authjs');

const authenticator = new Authenticator();

app.get('/', (req, res) => {
    res.send('Unprotected route.');
})

app.get('/protected', guard(authenticator), (req, res) => {
    res.send('Protected route.');
})

Documentation

Please refer to the documentation website on https://nerderbur.github.io/express-authjs

Changelog

Check the Github Releases page

License

MIT License

Keywords