Microservice to get the smallest positive integer not in array and retrieve statistics.
Development: Docker, Docker-compose, pytest, pylint.
Server: Python 3.9, Flask, Gunicorn, MongoDb.
Deployment: Dokku, Github Actions, codecov.
- Get the smallest positive integer not in array.
- Get total of unique arrays validated through the API.
- Get Count of occurrence as a calculation result from a number.
- Get ratio between the total count of arrays calculated and result occurrence count from a number.
- Get server status.
- https://kuriboh.pejedev.xyz/api/smallest
- https://kuriboh.pejedev.xyz/api/stats/5
- https://kuriboh.pejedev.xyz/api/health
Clone the project
git clone https://github.com/PejeDev/Kuriboh.git
Go to the project directory
cd Kuriboh
Start the server
docker-compose -D
POST /api/smallest
{
"array": [1, 3, 6, 4, 1, 2]
}
{
"result": 5
}
Property | Type | Description |
---|---|---|
result |
int |
Smallest positive integer not in array. |
GET /api/stats/${number}
Parameter | Type | Description |
---|---|---|
number |
int |
Required. Number to calculate stats. |
{
"count": 40,
"total": 100,
"ratio": 0.4
}
Property | Type | Description |
---|---|---|
count |
int |
Count of the parameter number occurrence as a calculation result. |
total |
int |
Number of unique arrays validated through the API and stored in a database. |
ratio |
float |
Ratio between the total count of arrays calculated and the number parameter occurrence count. |
GET /api/health
{
"successful": 1,
"failed": 0,
"total": 1,
"created": "Sat, 03 Sep 2022 06:13:45 GMT",
"updated": "Sat, 03 Sep 2022 06:13:45 GMT"
}
Property | Type | Description |
---|---|---|
successful |
int |
Count of successful requests. |
failed |
int |
Count of failed requests. |
total |
int |
Count of total requests. |
created |
str |
Server stats creation date. |
updated |
str |
Server stats last update date. |