GithubHelp home page GithubHelp logo

gazin-back's Introduction

Migrations:

Para rodar, precisará rodar as migrations antes, para rodar use o comando:

npx ts-node ./node_modules/.bin/typeorm migration:run

Obs: É necessário que o banco de dados já exista com o nome que está na ormconfig.json.

Rotas:

GET /api/developers

QueryString

limit: Número, limita quantos dados serão mostrados.
page: Número, qual página você quer buscar.
keyword: string, para buscar alguém pelo campo nome, que seja parecido.

Response

Status: 200
[
  {
    "id": 1,
    "name": "Tester",
    "gender": "M",
    "age": 27,
    "hobby": "Testar",
    "birthday": "1993-06-28T03:00:00.000Z",
    "created_at": "2021-02-09T02:54:35.429Z",
    "updated_at": "2021-02-09T03:25:01.709Z"
  }
]

QueryString Response

Status: 200
{
  "data": [
    {
      "id": 1,
      "name": "Tester",
      "gender": "M",
      "age": 27,
      "hobby": "Testar",
      "birthday": "1993-06-28T03:00:00.000Z",
      "created_at": "2021-02-09T02:54:35.429Z",
      "updated_at": "2021-02-09T03:25:01.709Z"
    }
  ],
  "count": 1
}

GET /api/developers/:id

Status: 200
[
  {
    "id": 1,
    "name": "Tester",
    "gender": "M",
    "age": 27,
    "hobby": "Testar",
    "birthday": "1993-06-28T03:00:00.000Z",
    "created_at": "2021-02-09T02:54:35.429Z",
    "updated_at": "2021-02-09T03:25:01.709Z"
  }
]

POST /api/developers

Request

{
	"name": "Tester",
	"gender": "M",
	"age": 27,
	"hobby": "Testar",
	"birthday": "06/28/1993"
}

Response

Status: 201
{
    "id": 1,
    "name": "Tester",
    "gender": "M",
    "age": 27,
    "hobby": "Testar",
    "birthday": "1993-06-28T03:00:00.000Z",
    "created_at": "2021-02-09T02:54:35.429Z",
    "updated_at": "2021-02-09T03:25:01.709Z"
  }

PUT /api/developers/:id

Request

{
	"name": "Tester",
	"gender": "M",
	"age": 28,
	"hobby": "Testar",
	"birthday": "06/28/1993"
}

Response

Status: 200
{
    "id": 1,
    "name": "Tester",
    "gender": "M",
    "age": 28,
    "hobby": "Testar",
    "birthday": "1993-06-28T03:00:00.000Z",
    "created_at": "2021-02-09T02:54:35.429Z",
    "updated_at": "2021-02-09T03:25:01.709Z"
  }

DELETE /api/developers/:id

Status: 204

gazin-back's People

Contributors

albinomn avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.