Skip to content

marlonconstante/customer-api

Repository files navigation

Customer API

REST API for customer registration.

Install and run application

$ docker-compose up --build

Access application terminal

$ docker-compose exec api sh

Test (in container)

# unit tests
~/api $ yarn test

# e2e tests
~/api $ yarn test:e2e

# test coverage
~/api $ yarn test:cov

Postman collection

api.postman_collection.json

API documentation (Swagger)

http://localhost:3000/api

HTTP requests

Create Customer

POST http://localhost:3000/api/customers
Content-Type: application/json

{
  "name": "Marlon Constante",
  "email": "marlon.constante@gmail.com",
  "birthDate": "1986-08-18"
}

Find Customers

GET http://localhost:3000/api/customers?page=1&size=10&name=Constante&email=marlon.constante@gmail.com&birthDate=1986-08-18

Get Customer

GET http://localhost:3000/api/customers/fe8173e9-6929-4f9b-82f0-488306e5cf5c

Update Customer

PATCH http://localhost:3000/api/customers/fe8173e9-6929-4f9b-82f0-488306e5cf5c
Content-Type: application/json

{
  "name": "Marlon Constante"
}

Remove Customer

DELETE http://localhost:3000/api/customers/fe8173e9-6929-4f9b-82f0-488306e5cf5c

Releases

No releases published

Packages

No packages published