From 167fe5f2536ae46793c5af145148255a94ba4c2e Mon Sep 17 00:00:00 2001 From: Rafael Bradley Date: Thu, 16 Jul 2026 02:34:24 -0300 Subject: [PATCH] Update README and index --- README.md | 2 +- nyekiapi/api/__init__.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f67a3b..237883c 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ This API is quite simple to self-host. Env variables: - `NYEKI_DEBUG`: Whether to start in debug mode. +- `NYEKI_REDIS_URL`: The Redis URL to use for caching. - `NYEKI_GITHUB_TOKEN`: A PAT token. You can get one [here](https://github.com/settings/tokens). - `NYEKI_DISCORD_TOKEN`: A bot token. You can get one @@ -23,7 +24,6 @@ Env variables: - `NYEKI_BIND_PORT`: Docker-only. The port to bind the API to. Defaults to `8000`. - `NYEKI_WORKERS`: Docker-only. The amount of async web workers to spawn. Defaults to `$(nproc)` (the amount of CPU cores). -- `NYEKI_REDIS_URL`: The Redis URL to use for caching. You can run it using uv by doing: diff --git a/nyekiapi/api/__init__.py b/nyekiapi/api/__init__.py index 4f33b18..9a748e1 100644 --- a/nyekiapi/api/__init__.py +++ b/nyekiapi/api/__init__.py @@ -16,6 +16,24 @@ app = FastAPI( ) +@app.get("/") +def index(): + return { + "title": "Nyeki's API", + "message": "Welcome to Nyeki's API! Refer to each version's documentation for more information.", + "versions": { + "v1": { + "base": "https://api.nyeki.dev/v1", + "docs": "https://api.nyeki.dev/v1/docs", + }, + "v2": { + "base": "https://api.nyeki.dev/v2", + "docs": "https://api.nyeki.dev/v2/docs", + } + } + } + + app.add_exception_handler(404, NotFoundError.handler)