This is a key‑value cache service with TTL and periodic tasks for deletion.
- Setup
.envfor this use example.env
PORT=8080 # Port for http
PERIODIC_SEC=10 # Poll the storage for deletion by ttl.- Routes
- GET
/- get all - 200 OK - DELETE
/:kid- 204 No Content - GET
/:kid- get by key - 200 OK
{
"new": {
"ttl": "1788763361206478µs", // or null if not set
"value": "test2"
}
}- POST
/- 201 Created
{
"key": "new",
"value": {
"value": "test2",
"ttl": 5 // now + 5 seconds. This nullable
}
}- Switch from HTTP to binary protocol and use client for connect.
- Add auth to connect.