ServerHub is a simple configuration-as-a-service platform that allows you to store and retrieve configurations through REST APIs. Store your application settings, feature flags, and environment variables in a centralized location with path-based organization.
If you have Docker installed, check out our DOCKER.md guide for the easiest way to run ServerHub. You can get started with just one command!
- Python 3.x
uvpackage manager
-
Install
uv(if not already installed):brew install uv
-
Sync dependencies:
uv sync
-
Start the development server:
uv run fastapi dev
The server will start at http://localhost:8000
Check if the API is running:
curl -X GET "http://localhost:8000/health"All configuration endpoints require a key header to group configurations.
curl -X POST "http://localhost:8000/config/" \
-H "key: my-app-config" \
-H "Content-Type: application/json" \
-d '{
"database_url": "postgresql://localhost:5432/mydb",
"debug": true,
"max_connections": 100
}'curl -X GET "http://localhost:8000/config/" \
-H "key: my-app-config"curl -X GET "http://localhost:8000/config/item/?config_key=database_url" \
-H "key: my-app-config"curl -X PUT "http://localhost:8000/config/" \
-H "key: my-app-config" \
-H "Content-Type: application/json" \
-d '{
"debug": false,
"max_connections": 200
}'curl -X DELETE "http://localhost:8000/config/item/?config_key=debug" \
-H "key: my-app-config"curl -X DELETE "http://localhost:8000/config/key-group/" \
-H "key: my-app-config"Access the interactive API documentation at:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
The Swagger interface allows you to explore all endpoints, view request/response schemas, and test API calls directly from your browser.