Skip to content

Xela url hackfest 2023 backend service from the ScriptSquad team

Notifications You must be signed in to change notification settings

danieltistoj/backend-hackfest2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend Service Hackfest 2023

Technologies

Rafa-Csharp Rafa-Csharp Rafa-Csharp Rafa-Csharp Rafa-Csharp

Instalar dependencias

npm i

Ejecutar en local

npm run dev

Dependencies

    "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"

DevDependencies

"nodemon": "^2.0.22"

Documentation

Host

  • DEV: http://backend-hackfest2023-dev.up.railway.app
  • Local: http://localhost:4000

User

Data Model

Field Type Required Trim Default Value
name String Yes Yes -
password String Yes Yes -
email String Yes Yes Undefined
profilePhoto String No Yes ""
publicId String No No -
matchList Array No Yes []
phone String No Yes ""
rol String Yes Yes ""

Create User

Creates a new user.

  • Method: POST
  • URL: {{host}}/api/v1/user/create-user

Request body:


{
    "name": "Ejemplo",
    "password": "MyPassword",
    "email": "[email protected]"
}

All Users

Retrieves all users.

  • Method: GET
  • URL: {{host}}/api/v1/user/all-users

Get User By Name

Retrieves a user by their name.

  • Method: GET
  • URL: {{host}}/api/v1/user/getUserByName/{name}
  • Replace {name} with the user's name.

Get User By Id

Retrieves a user by their ID.

  • Method: GET
  • URL: {{host}}/api/v1/user/getUserById/{id}
  • Replace {id} with the user's ID.

Update User By 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]"
}

Delete User By Id

Deletes a user by their ID.

  • Method: DELETE
  • URL: {{host}}/api/v1/user/deleteUserById/{id}
  • Replace {id} with the user's ID.

Pet

Data Model

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 -

Create Pet

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

All Pets

Retrieves all pets.

  • Method: GET
  • URL: {{host}}/api/v1/pet/all-pet

Deployment

User-deploy

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.

Thanks for watching

About

Xela url hackfest 2023 backend service from the ScriptSquad team

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published