API for currency conversion using TDD.
$ yarn install
Obs: I used MongoDB Atlas for the database service.
# development
$ yarn start
# watch mode
$ yarn start:dev
Routes of aplication:
# Create Currency
# POST /currencies
curl -d '{"currency": "BRL", "value": 1}' -H "Content-Type: application/json" -X POST http://localhost:3000/currencies
# Get Currency
# GET /currencies/:currency
curl 'http://localhost:3000/currencies/BRL'
# Update Currency
# PATCH /currencies/:currency/value
curl -d '{"value": 0.5}' -H "Content-Type: application/json" -X PATCH http://localhost:3000/currencies/BRL/value
# Delete Currency
# DELETE /currencies/:currency
curl -X DELETE http://localhost:3000/currencies/BRL
# Convert Amount
# GET /exchange?from=currency&to=currency&amount=amount
curl 'http://localhost:3000/exchange?from=BRL&to=USD&amount=5'
# unit tests
$ yarn test
# test coverage
$ yarn test:cov
- Author - Lemuel Coelho Zara
Exchange API is MIT licensed.