HTTP Client/Server KV
You can serve any KV
using ServerKV
, and access it using ClientKV
.
Example
Server
import uvicorn
from kv import KV, ServerKV
kv = KV.of('file://path/to/folder')
api = ServerKV(kv) # FastAPI
uvicorn.run(api, host='0.0.0.0', port=8000)
Or you can use the CLI:
Client
Authentication
Server
import uvicorn
from kv import KV, ServerKV
kv = KV.of('file://path/to/folder')
api = ServerKV(kv, secret='supersecret')
uvicorn.run(api, host='0.0.0.0', port=8000)