-Colocar as cofigurações do banco Mysql nos arquivos (./config/config.json) e (./config/dbConfig.js)
- No Arquivo ./appsetting.js colocar um email Gmail e senha
- verifique se a opção deste link esta ativada.
npm install
npx sequelize-cli db:migrate
npm run test
npm start
A Collection do Postman se encontra na raiz do projeto com o nome collectionPostman.json
GET /clientes/
'Accept: application/json' http://localhost:3000/clientes/
HTTP/1.1 200 OK
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 2
[]
POST /clientes/
'Accept: application/json' 'name=Foo&status=new' http://localhost:3000/clientes
HTTP/1.1 201 Created
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 201 Created
Connection: close
Content-Type: application/json
Location: /thing/1
Content-Length: 36
{"ClienteId":1,"Nome":"João","Email":"[email protected]", Sexo:"Masculino" CPF:11 }
GET /clientes/id
'Accept: application/json' http://localhost:3000/clientes/1
HTTP/1.1 200 OK
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 36
{"ClienteId":1,"Nome":"João","Email":"[email protected]", Sexo:"Masculino" CPF:11 }
PUT /clientes/:id
'Accept: application/json' http://localhost:3000/clientes/1
HTTP/1.1 200 OK
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 40
{"ClienteId":1,"Nome":"João","Email":"[email protected]", Sexo:"Masculino" CPF:11 }
DELETE /clientes/id
'Accept: application/json' http://localhost:3000/clientes/1/
HTTP/1.1 204 No Content
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 204 No Content
Connection: close
GET /produtos/
'Accept: application/json' http://localhost:3000/produtos/
HTTP/1.1 200 OK
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 2
[]
POST /produtos/
'Accept: application/json' http://localhost:3000/produtos
HTTP/1.1 201 Created
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 201 Created
Connection: close
Content-Type: application/json
Location: /thing/1
Content-Length: 36
{"ProdutoId":1, "Nome":"Feijão","Cor":"Marrom","Tamanho": "25x10","Valor":7}
GET /produtos/id
'Accept: application/json' http://localhost:3000/produtos/1
HTTP/1.1 200 OK
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 36
{"ProdutoId":1, "Nome":"Feijão","Cor":"Marrom","Tamanho": "25x10","Valor":7}
PUT /produtos/:id
'Accept: application/json' http://localhost:3000/produtos/1
HTTP/1.1 200 OK
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 40
{"ProdutoId":1, "Nome":"Feijão","Cor":"roxo","Tamanho": "25x10","Valor":10}
DELETE /produtos/id
'Accept: application/json' http://localhost:3000/produtos/1/
HTTP/1.1 204 No Content
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 204 No Content
Connection: close
GET /pedidos/
'Accept: application/json' http://localhost:3000/pedidos/
HTTP/1.1 200 OK
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 2
[]
POST /pedidos/
'Accept: application/json' http://localhost:3000/pedidos
HTTP/1.1 201 Created
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 201 Created
Connection: close
Content-Type: application/json
Location: /thing/1
Content-Length: 36
{
"ClienteId":4,
"FormaPagamento":"Dinheiro",
"Observacao":"teste observação",
"Data":"2021-03-31T22:36:00.000",
"Produtos":[
{
"ProdutoId":3,
"Quantidade":5
},
{
"ProdutoId":1,
"Quantidade":10
}]
}
GET /pedidos/id
'Accept: application/json' http://localhost:3000/pedisos/1
HTTP/1.1 200 OK
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 36
{
"PedidoId": 27,
"Data": "2021-04-01T01:36:00.000Z",
"Observacao": "teste observação",
"FormaPagamento": "Dinheiro",
"Cliente": "Caio Henrique De Carvalho LIma",
"Produtos": [
{
"ProdutoId": 3,
"Nome": "Arroz",
"Cor": "Branco",
"Tamanho": "25x10",
"Quantidade": 5,
"Valor": "15"
}
]
}
PUT /pedidos/:id
'Accept: application/json' http://localhost:3000/pedidos/1
HTTP/1.1 200 OK
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 200 OK
Connection: close
Content-Type: application/json
Content-Length: 40
{
"PedidoId": 27,
"Data": "2021-04-01T01:36:00.000Z",
"Observacao": "teste observação",
"FormaPagamento": "Dinheiro",
"Cliente": "Caio Henrique De Carvalho LIma",
"Produtos": [
{
"ProdutoId": 3,
"Nome": "Arroz",
"Cor": "Branco",
"Tamanho": "25x10",
"Quantidade": 5,
"Valor": "15"
}
]
}
DELETE /pedidos/id
'Accept: application/json' http://localhost:3000/pedidos/1/
HTTP/1.1 204 No Content
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 204 No Content
Connection: close
POST /pedidos/:id/report
'Accept: application/json' http://localhost:3000/pedidos/1/report
HTTP/1.1 200 ok
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 204 No Content
Connection: close
POST /pedidos/:id/sendmail
'Accept: application/json' http://localhost:3000/pedidos/1/sendmail
HTTP/1.1 200 ok
Date: Thu, 24 Apr 2021 12:36:30 GMT
Status: 204 No Content
Connection: close