POC API for scoring CPFs based on F# (Dotnet 6) and the Saturn Framework.
- Pull and run the latest version of Postgres (docker installation required)
docker run --name db-pgsql -e POSTGRES_PASSWORD=passw0rd -p 5432:5432 -d postgres
- Clone the repository and move to its directory (git installation required)
git clone https://github.com/alsnrbernardo/score-api.git && cd score-api
- Set up the dependencies
dotnet tool restore && dotnet paket install
- Build the solution
dotnet build .
- Perform database migration (depends on Postgres container)
dotnet run --project src/Migrations
- Run the application (available at http://localhost:8085)
dotnet run --project src/Scoring-API
API endpoints:
GET /health
check if the server is running.
curl --request GET \
--url http://localhost:8085/health
GET /score/<CPF>
fetches the values and creation dates of scores attributed to the given CPF.
curl --request GET \
--url http://localhost:8085/score/xxxxxxxxxxx \
--header 'Content-Type: application/json'
POST /score
scores and registers the provided CPF
curl --request POST \
--url http://localhost:8085/score \
--header 'Content-Type: application/json' \
--data '{ "cpf": "xxxxxxxxxxx" }}'