Sign inSign up

lichodev/fvl-api

By lichodev

•Updated about 3 years ago

Fantasy Volleyball League API

Image
0

1.1K

lichodev/fvl-api repository overview

Nest Logo ⁠ FCEx Logo ⁠

A progressive Node.js⁠ framework for building efficient and scalable server-side applications.

⁠Description

Nest⁠ framework TypeScript starter repository.

Deploy: Render - https://fvl-api.onrender.com/⁠

⁠Installation

$ npm install

⁠Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

⁠API Endpoints

⁠Matchs

GET /matchs

Retrieve all Matchs.

  • Query parameters

    • populate: Boolean. Example: GET /matchs?populate=true
  • Response

    [
      {
        id: 'number',
        // If populate truthy, sends team object instead of id
        local: 'Team | number',
        visitante: 'Team | number',
        sets_local: 'number',
        sets_visitante: 'number',
      },
      // ...
    ];
    

GET /matchs/:id

Retrieve a single Match data, including teams objects.

  • Response:

    {
      "id": "number",
      "local": "Team",
      "visitante": "Team",
      "sets_local": "number",
      "sets_visitante": "number"
    }
    

POST /matchs/

Creates a new Match. "Local" and "Visitante" are Team's ID.

  • Request body:

    {
      "local": "number",
      "visitante": "number",
      "sets_local": "number",
      "sets_visitante": "number"
    }
    
  • Response:

    {
      "id": "number",
      "local": "number",
      "visitante": "number",
      "sets_local": "number",
      "sets_visitante": "number"
    }
    

PUT /matchs/:id

Updates an existing Match

  • Request body:

    {
      "local": "number",
      "visitante": "number",
      "sets_local": "number",
      "sets_visitante": "number"
    }
    
  • Response:

    {
      "id": "number",
      "local": "number",
      "visitante": "number",
      "sets_local": "number",
      "sets_visitante": "number"
    }
    

DELETE /matchs/:id

Deletes an existing Match. If successful, no response is sent.

⁠Teams

GET /teams

Retrieve all teams.

  • Response

    [
      {
        id: 'number',
        name: 'string',
        short_name: 'string',
        country: 'string',
        location: 'string',
      },
      // ...
    ];
    

GET /teams/:id

Retrieve a single Team data, including an array with Matchs played.

  • Response:

    {
      "id": "number",
      "name": "string",
      "short_name": "string",
      "country": "string",
      "location": "string",
      "matchsLocal": "Match[]",
      "matchsVisitante": "Match[]"
    }
    

POST /teams/

Creates a new Team

  • Request body:

    {
      "name": "string",
      "short_name": "string",
      "country": "string",
      "location": "string"
    }
    
  • Response:

    {
      "id": "number",
      "name": "string",
      "short_name": "string",
      "country": "string",
      "location": "string"
    }
    

PUT /teams/:id

Updates an existing Team

  • Request body:

    {
      "name": "string",
      "short_name": "string",
      "country": "string",
      "location": "string"
    }
    
  • Response:

    {
      "id": "number",
      "name": "string",
      "short_name": "string",
      "country": "string",
      "location": "string"
    }
    

DELETE /teams/:id

Deletes an existing Team. If successful, no response is sent.

⁠License

Nest is MIT licensed⁠.

Tag summary

Content type

Image

Digest

sha256:a4f995bec…

Size

102.2 MB

Last updated

about 3 years ago

docker pull lichodev/fvl-api