Instalar dependencias
npm i
Ejecutar en local
npm run dev
"body-parser": "^1.20.2",
"cloudinary": "^1.37.1",
"cors": "^2.8.5",
"dotenv": "^16.1.4",
"express": "^4.18.2",
"express-fileupload": "^1.4.0",
"fs-extra": "^11.1.1",
"mongoose": "^6.6.1",
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1"
"nodemon": "^2.0.22"
Host
- DEV:
http://backend-hackfest2023-dev.up.railway.app
- Local:
http://localhost:4000
Field | Type | Required | Trim | Default Value |
---|---|---|---|---|
name | String | Yes | Yes | - |
password | String | Yes | Yes | - |
String | Yes | Yes | Undefined | |
profilePhoto | String | No | Yes | "" |
publicId | String | No | No | - |
matchList | Array | No | Yes | [] |
phone | String | No | Yes | "" |
rol | String | Yes | Yes | "" |
Creates a new user.
- Method: POST
- URL:
{{host}}/api/v1/user/create-user
Request body:
{
"name": "Ejemplo",
"password": "MyPassword",
"email": "[email protected]"
}
Retrieves all users.
- Method: GET
- URL:
{{host}}/api/v1/user/all-users
Retrieves a user by their name.
- Method: GET
- URL:
{{host}}/api/v1/user/getUserByName/{name}
- Replace
{name}
with the user's name.
Retrieves a user by their ID.
- Method: GET
- URL:
{{host}}/api/v1/user/getUserById/{id}
- Replace
{id}
with the user's ID.
Updates a user by their ID.
- Method: PUT
- URL:
{{host}}/api/v1/user/updateUserById/{id}
- Replace
{id}
with the user's ID.
Request body:
{
"email": "[email protected]"
}
Deletes a user by their ID.
- Method: DELETE
- URL:
{{host}}/api/v1/user/deleteUserById/{id}
- Replace
{id}
with the user's ID.
Field | Type | Required | Trim | Default Value |
---|---|---|---|---|
name | String | Yes | Yes | - |
profilePhoto | String | No | No | "" |
publicId | String | No | No | - |
race | String | Yes | Yes | - |
age | String | Yes | Yes | - |
sex | Number | Yes | Yes | - |
description | String | No | Yes | - |
Creates a new pet.
- Method: POST
- URL:
{{host}}/api/v1/pet/create-pet
Request body:
{
"name": "firulais",
"image": [file],
"race": "mestizo",
"age": "2 meses",
"sex": 1,
"description": "Es un perro muy amigable"
}
If Postman is used, a form-data format must be used for this endpoint
Retrieves all pets.
- Method: GET
- URL:
{{host}}/api/v1/pet/all-pet
These endpoints are available in the deployed version of the API.
- Base URL:
http://backend-hackfest2023-dev.up.railway.app
Please note that the deployed version may have different behavior or limitations compared to the local version.