fparadas / Datarisk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Datarisk Case

An API for creating and accessing cpf scoring

Endpoints

  • GET localhost:8085/migrate -> run all the migrations on the Postgres connection
  • POST localhost:8085/api {"cpf": "000-000-000/00"} -> Insert a user on the database, with the generated score for the CPF
  • GET localhost:8085/api/ -> Returns a Json containing the info on the DB of that CPF, example:
  [
  {
    "id": 1,
    "cpf": "00000000191",
    "score": 860,
    "createdAt": "07/16/2021 17:54:55"
  }
]
  • GET localhost:8085/api -> Returns a list with all the records on the database

Running the application

After cloning the repository and cd into it, the first thing we need to do is to run a docker-compose up to get the Postgres database running, you can do that using the following commands:

cd /src
docker-compose up -d

After it, it will be necessary to restore the packages of the application then run the app

cd /Score
dotnet restore
dotnet run

Right now you can run your requests on Postman or similar softwares.

About


Languages

Language:F# 94.2%Language:Dockerfile 5.8%