Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PORT=3000
MONGO_USER=
MONGO_USER=root
MONGO_PASSWORD=
MONGO_HOST=
MONGO_DB_NAME=
MONGO_PORT=
MONGO_HOST=localhot
MONGO_DB_NAME=platzi
MONGO_PORT=3306
MONGO_CONNECTION=
88 changes: 87 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
"description": "Reto 9 Octubre 26: Curso de Backend con Node",
"main": "index.js",
"dependencies": {
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"mongodb": "^3.6.6"
"mongodb": "^3.6.6",
"mysql": "^2.18.1",
"swagger-ui-express": "^4.1.6"
},
"devDependencies": {
"jest": "^26.6.3",
Expand All @@ -25,7 +28,7 @@
},
"keywords": [],
"author": "",
"license": "ISC",
"license": "MIT",
"bugs": {
"url": "https://github.com/platzi/escuelajs-reto-09/issues"
},
Expand Down
Binary file added platzi.mwb
Binary file not shown.
204 changes: 204 additions & 0 deletions platzi.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
{
"info": {
"_postman_id": "66f5d3f4-e55a-4668-81e7-538753045f65",
"name": "platzi",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "get products",
"request": {
"method": "GET",
"header": [],
"url": "localhost:3000/api/products"
},
"response": []
},
{
"name": "get products id",
"request": {
"method": "GET",
"header": [],
"url": "localhost:3000/api/products/2"
},
"response": []
},
{
"name": "post products",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "name",
"value": "queso",
"type": "text"
},
{
"key": "price",
"value": "10",
"type": "text"
},
{
"key": "description",
"value": "manchego",
"type": "text"
},
{
"key": "img",
"value": "asdasdasd",
"type": "text"
},
{
"key": "category_id",
"value": "1",
"type": "text"
}
]
},
"url": "localhost:3000/api/products"
},
"response": []
},
{
"name": "put products id",
"request": {
"method": "PUT",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "name",
"value": "leche",
"type": "text"
},
{
"key": "price",
"value": "10",
"type": "text"
},
{
"key": "description",
"value": "leche ligh",
"type": "text"
},
{
"key": "img",
"value": "asdasdasd",
"type": "text"
},
{
"key": "category_id",
"value": "1",
"type": "text"
},
{
"key": "",
"value": "",
"type": "text",
"disabled": true
}
]
},
"url": "localhost:3000/api/products/1"
},
"response": []
},
{
"name": "delete products id",
"request": {
"method": "DELETE",
"header": [],
"url": "localhost:3000/api/products/2"
},
"response": []
},
{
"name": "get categories",
"request": {
"method": "GET",
"header": [],
"url": "localhost:3000/api/categories"
},
"response": []
},
{
"name": "get categories id",
"request": {
"method": "GET",
"header": [],
"url": "localhost:3000/api/categories/1"
},
"response": []
},
{
"name": "post categories",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "name",
"value": "electronicos",
"type": "text"
},
{
"key": "img",
"value": "asdasd",
"type": "text"
}
]
},
"url": "localhost:3000/api/categories"
},
"response": []
},
{
"name": "put categories id",
"request": {
"method": "PUT",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "name",
"value": "electronicos2",
"type": "text"
},
{
"key": "img",
"value": "asdasdasd",
"type": "text"
}
]
},
"url": "localhost:3000/api/categories/2"
},
"response": []
},
{
"name": "delete categories id",
"request": {
"method": "DELETE",
"header": [],
"url": "localhost:3000/api/categories/2"
},
"response": []
},
{
"name": "get categories id products",
"request": {
"method": "GET",
"header": [],
"url": "localhost:3000/api/categories/1/products"
},
"response": []
}
]
}
Loading