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

https://github.com/markkos89/nodejs-mysql-rest-api-boilerplate

nodejs-JWT-auth-mysql-REST-API-boilerplate
https://github.com/markkos89/nodejs-mysql-rest-api-boilerplate

Last synced: about 1 year ago
JSON representation

nodejs-JWT-auth-mysql-REST-API-boilerplate

Awesome Lists containing this project

README

          

## Nodejs RESTful API Boilerplate with JSONWebToken | Express Js

### How to use

- Clone the repository with __git clone__
- Run __npm install__
- Run __cp .env.example .env__ for create .env file
- Import __db.sql__ database
- Edit database credentials __.env__ file
- Run __npm run dev__ for start server

### Serve run http://localhost:8080

## API Endpoints

#### Welcome
- **GET api/welcome**

#### Authentication
- **POST api/login**

#### Registration
- **POST api/register**
- **POST api/account-verification**
- **POST api/account-verification-resend**

#### Password Reset
- **POST api/password/forgot**
- **POST api/password/forgot-code-match**
- **POST api/password/reset**

#### User
- **GET api/users**
- **PUT api/users/:id/toggle-status**

## API Status Code

Following status codes in its API:

| Status Code | Description |
| :--- | :--- |
| `2xx Success` |
| 200 | `Success` |
| 201 | `Created` |
| `4xx Client Error` |
| 400 | `Bad Request` |
| 401 | `Unauthorized` |
| 404 | `Not Found` |
| `5xx Server Error` |
| 500 | `Internal Server Error` |