kotalco / core-api

Kotal core API
0 stars 0 forks source link

feat: read endpoint stats completed #284

Closed mohamed-abdelrhman closed 1 year ago

mohamed-abdelrhman commented 1 year ago

@mFarghaly i have concern is it gonna be difficult for the front end to correlate between the endpoint and it's activity get endpoint details response /endpoint/:name

"data": {
        "name": "test-bridge",
        "protocol": "ipfs",
        "network": "",
        "created_at": "2023-08-29T21:39:23Z",
        "routes": [
            {
                "name": "api",
                "route": "https://endpoints.mohamed-test-co.software/1eda75e1-8374-4933-932a-94efa14b5862",
                "example": "curl -X POST https://endpoints.mohamed-test-co.software/1eda75e1-8374-4933-932a-94efa14b5862/api/v0/swarm/peers",
                "references": [
                    "https://docs.ipfs.tech/reference/kubo/rpc/"
                ],
            }
        ]
    }
}

endpoint stats response /endpoint/:name/stats

"data": {
        "name": "test-bridge",
        "protocol": "ipfs",
        "routes": [
            {
                "name": "api",
                "hits": 0
            }
        ]
    }
mohamed-abdelrhman commented 1 year ago

read stats response has become

{
    "data": {
        "api": {
            "monthly_hits": 2
        }
    }
}