https://github.com/raulrobinson/nodejs-jwt-mysql
Back-End for Login & Roles and JWT with NodeJS and MySQL for AutoMOX Control System.
https://github.com/raulrobinson/nodejs-jwt-mysql
Last synced: 2 months ago
JSON representation
Back-End for Login & Roles and JWT with NodeJS and MySQL for AutoMOX Control System.
- Host: GitHub
- URL: https://github.com/raulrobinson/nodejs-jwt-mysql
- Owner: raulrobinson
- Created: 2024-04-02T11:39:24.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-02T23:25:14.000Z (about 1 year ago)
- Last Synced: 2025-01-27T04:18:05.901Z (4 months ago)
- Language: JavaScript
- Homepage: https://nodejs-jwt-mysql.vercel.app
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nodejs-jwt-mysql
Back-End for Login & Roles and JWT with Node.js and MySQL for AutoMOX Control System.
- **Register**
Request:
```javascript
curl --location 'http://localhost:3000/api/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Raul Bolivar",
"email": "[email protected]",
"password": "Password01"
}'
```Response:
```json
{
"data": {
"id": 3,
"name": "Raul Bolivar",
"email": "[email protected]",
"password": "$2b$10$shZPeuYlD2vatymflpSvyeA75sfZPWMUlfFTWwg6gmwv68KTOQ9B.",
"updated_at": "2024-04-02T22:53:30.468Z",
"created_at": "2024-04-02T22:53:30.468Z"
},
"message": "User registered successfully."
}
```- **Login**
Request:
```javascript
curl --location 'http://localhost:3000/api/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "Password01"
}'
```
Response:```javascript
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaWF0IjoxNzEyMDk4MjUyLCJleHAiOjE3MTIxMDE4NTJ9.NmdTIjl3Rq3sbRgltVj-DPgczq8aYckzoLqc3uUgeDg",
"token_type": "Bearer",
"expires_in": 3600
}
```---
*Raul Bolivar Navas **@rasysbox***