Module to reuse authentication part. If you are bored to code authentication part on your side project this module is for you!
-
Clone this repo
-
Install dependencies:
npm install
- Run the following command:
npm run sample
- localhost:3000/ is ready to do requests (use your favourite API development environment as CURL, POSTMAN or whatever you want)
- Install
authentication-api
:
npm install authentication-api
- Import module
var authApi = require('authentication-api');
- Set authentication-api routes on your express routes:
app.use('/*', authApi.router);
Method | url | data | description |
---|---|---|---|
POST | /signup | {email: ..., password: ...} | create user |
POST | /login | {email: ..., password: ...} | check email/password are correct and return token |
- [] Testing
- [] Create middleware to check user is logged
- [] Reset password
- [] Accept other databases (MySql, PostgreSQL)
MIT