cd frontend
npm i
npm run dev
Open http://localhost:8882 with your browser to see the result.
cd backend
npm i
npm run start:dev
Where full URLs are provided in responses they will be rendered as if service is running on 'http://localhost:8333/'.
Open endpoints require no Authentication.
Endpoints for viewing and manipulating the Accounts that the Authenticated User has permissions to access.
- Get all Products :
GET /v1/products/
- Get Single Product :
GET /v1/products/:IdProduct
- Add Single Product :
POST /v1/products/:IdProduct
- Update Single Product :
PUT /v1/products/:IdProduct
- Delete Single Product :
DELETE /v1/products/:IdProduct
Content-Type: application/json
{
"NameProduct": "Manzana Verde",
"Category": "Bebida",
"Description": "Refresco de lata",
"ProductQuantity": 1,
"Status": true
}
Message : String response
Status : 200
Product : JSON product response
Content example : For the example above, when the 'name' is updated and
posted to /v1/product/:IdProduct
...
{
"message": "Product update",
"product": {
"NameProduct": "Manzana Verde",
"Category": "Bebidas",
"Description": "Refresco de lata",
"ProductQuantity": 15,
"Status": true,
"TimeStamp": "2021-01-13T23:22:47.486Z",
"IdProduct": "5fff80c748c2be80a36d34c3"
},
"status": 200
}
Message : JSON response
Status : 403
Content example : For the example above, when the 'name' is post and
posted to /v1/product
...
{
"message": {
"Category": {
"name": "ValidatorError",
"message": "`nr` is not a valid enum value for path `Category`.",
"properties": {
"message": "`nr` is not a valid enum value for path `Category`.",
"type": "enum",
"enumValues": [
"Bebidas",
"Limpieza",
"Botanas",
"Cremeria"
],
"path": "Category",
"value": "nr"
},
"kind": "enum",
"path": "Category",
"value": "nr"
}
},
"product": {},
"status": 403
}
nest new backend
yarn create next-app frontend
brew install mongodb-community
node v12.13.0
npm v6.14.9
yarn v1.22.10
Cristian Yosafat Hernández Ruiz