An open API service indexing awesome lists of open source software.

https://github.com/amass01/node-user-engine

An user authentication engine written in nodejs on a mongodb database.
https://github.com/amass01/node-user-engine

expressjs jwt jwt-authentication mongodb mongoose nodejs

Last synced: 3 months ago
JSON representation

An user authentication engine written in nodejs on a mongodb database.

Awesome Lists containing this project

README

          

# node-user-engine

An Express.js authentication seed server, written on top of mongo database.

###### Local dev:

- Simply clone the source code and run `npm run start` to start the app on port `9191`

##### Endpoints:

- `/` - main route shows welcome message
- Method: GET
- Not authenticated - can be reached without token
- `/api/user` - list all users
- Method: GET
- Authenticated
- `/api/user/create` - creates new user
- Method: POST
- Authenticated
- Payload: ` { name: string, password: string, isAdmin: boolean} `
- Response: `{ success: boolean } `
- `/api/authenticate` - verify user's password against db and return token on success.
- Method: POST
- Not authenticated - can be reached without token
- Payload: ` { name: string, password: string, isAdmin: boolean} `
- Response: `{ success: boolean, token: string } `