/tdd-exchange-api

TDD (Test Driven Development) Exchange API with Nest.JS

Primary LanguageTypeScriptMIT LicenseMIT

Open Source GPLv3 License Build Status Coverage Status

TDD Exchange API

Rest API made in MongoDB, Nestjs, using TDD (Test Driven Development), TypeORM and TypeScript.

Requisits to run this project

  • docker
  • docker-compose
  • npm

Running the app

$ npm i
$ docker-compose up --build
# listening in http://localhost:3000

Test

# unit tests
$ npm run test

# test coverage
$ npm run test:coveralls

Screenshot-from-2021-01-14-02-41-25

Endpoints

Currency exchange

GET
http://localhost:3003/exchange/?from=USD&to=BRL&amount=1

Create Currency

POST
http://localhost:3003/currencies/
Put values in body:
currency=BRL
value=0.2

Update Currency Value

PATCH
http://localhost:3003/currencies/BRL/value
Put value in body:
value=0.22

Delete Currency

DELETE
http://localhost:3003/currencies/BRL