Skip to content

batcoder1/products

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Finton

Products CRUD, user signup and login. Application with jwt token authetication method.

Endpoints

POST products/create

Create a new product in BD. Some field are required

Request example:

  headers.autentication: token *tokenAuth*

  body:{
    "name": "Trackpad mac",
    "description": "mouse trackpad"
  } 

POST products/delete

Delete a product from DB. ProductId property are required in body section.

Request example:

  headers.autentication: token *tokenAuth*

  body: {	
    "productId": "5c882bee5b0b834fbeca50ca" 
  } 

GET products

Get all products

POST user/signup

Create a new user in DB. Email and password are required in body section.

Request example:

  body: {
    "email": "[email protected]",
    "password": "pass1234"
  }

POST user/login

Aplication login endpoint. Email and password data are required in body section. When login is succesfull the request responds with tokenAuth property that must be used to authenticate in follows requests.

Request example:

  body:{	
    "email": "[email protected]",
    "password": "pass1234"
  }

Postman test

Collection (copy link and add to postman)

https://www.getpostman.com/collections/7361e018c8a0edd6c6ef

Environment

VARIABLE VALUE

url http://localhost:3003

token token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9....

Error Codes

BRP: Bad request params; U001: Error, creating user; U002: email or password incorrect; P001: Error creating product; P002: Error getting products

About

products CRUD with jwt authentication

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published