/exchange-api

💱 API para conversão de moedas usando o NestJS.

Primary LanguageTypeScriptMIT LicenseMIT

Exchange image

Node.js   TypeScript   NestJS   NestJS  

Exchange API

API for currency conversion using TDD.


👷 Installation

$ yarn install

🏃 Running the app

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'

🧪 Test

# unit tests
$ yarn test

# test coverage
$ yarn test:cov

📮 Stay in touch


📕 License

Exchange API is MIT licensed.