0.0.41 • Published 7 years ago
authentication-api v0.0.41
AUTHENTICATION-API
Module to reuse authentication part. If you are bored to code authentication part on your side project this module is for you!
RUN SAMPLE
Clone this repo
Install dependencies:
npm installRun the following command:
npm run samplelocalhost:3000/ is ready to do requests (use your favourite API development environment as CURL, POSTMAN or whatever you want)
HOW TO USE IN YOUR PROJECT?
Install
authentication-api:npm install authentication-apiImport module
var authApi = require('authentication-api');- Set authentication-api routes on your express routes:
app.use('/*', authApi.router);Routes that were generated:
| Method | url | data | description |
|---|---|---|---|
| POST | /signup | {email: ..., password: ...} | create user |
| POST | /login | {email: ..., password: ...} | check email/password are correct and return token |
TODO
- [] Testing
- [] Create middleware to check user is logged
- [] Reset password
- [] Accept other databases (MySql, PostgreSQL)
license
MIT