-
Clone repo
git clone https://github.com/CoyoteRulea/nodeAPI.git
-
Go to created folder
cd nodeAPI
-
Install all dependencies and packages
npm install
-
Check if your config at .env is ok
-
Check if your config at app/config/db.config.js is ok
-
Run DB Update to create tables with
npm run dbupdate
This create tables and a default user with values at .env file.
- Create listen server
Standard server
- without auth run
npm run start
- with auth run
npm run authstart
For dev mode
- without auth run
npm run dev
- with auth run
npm run authdev
- Enjoy
https://www.postman.com/coyoterulea/workspace/nodeapi/overview
Those are located at nodeAPI requests
- Save Item
Add one item to inventory list and need to have following body request params like json
{
"model" : "Civic",
"brand" : "Honda",
"type" : "S",
"wheels" : 4,
"power" : "200 cc"
}
- Get Inventory List
Get the inventory list.
Those are located at AUTH nodeAPI requests
- Authenticate
Check if user/pass is valid in this API. You need to run this call first to obtain a valid refreshToken Inputs:
{
"user_name" : "admin",
"password" : "admin123"
}
Outputs: accessToken, refreshToken
- Create User
Creates a new user with values assigned.
{
"user_name" : "vmendez5",
"password" : "password5",
"first_name" : "Victor",
"last_name" : "Mendez",
"email" : "[email protected]",
"token" : "GENERATED REFRESH TOKEN"
}
- Save Item
Add one item to inventory list and need to have following body request params like json
{
"model" : "Civic",
"brand" : "Honda",
"type" : "S",
"wheels" : 4,
"power" : "200 cc",
"token" : "GENERATED REFRESH TOKEN"
}
- Get Inventory List
Get the inventory list.
{
"token" : "GENERATED REFRESH TOKEN"
}
- Get tokens
Get the current token list active
- Validate token
Check if a requested token is valid
{
"token" : "GENERATED REFRESH TOKEN"
}