This directory is a Cloudflare Python Worker port of the uploaded FastAPI VoxelHTTP server. It retains the /v4, /v5, and /v6 endpoints and reuses the existing Pydantic response models. Database access is changed from a local SQLModel/SQLite session to Cloudflare D1 prepared statements.
GET/HEAD /v4/pingThe following operations deliberately remain 501 Not Implemented, matching the original project: resource/image uploads, statistics creation, translation upload, and v6 notification endpoints. Authentication-dependent writes were already stubs in the uploaded API; this port does not invent their behavior.
Install a current Node.js LTS and Wrangler, then from this directory run:
npx wrangler d1 create voxelhttp-db
Copy the returned database ID into wrangler.jsonc in place of REPLACE_WITH_YOUR_D1_DATABASE_ID. Keep database_name in sync if you chose another name.
The original README points to the CSNZ voxel metadata SQLite database. Download that database and export it to SQL. D1 imports SQL text, not the binary SQLite file itself (see Cloudflare’s import guide).
python scripts/export_sqlite.py voxelhttp_metadata_distilled.sqlite.db > metadata.sql
npx wrangler d1 execute voxelhttp-db --remote --file=metadata.sql
If you are testing without an existing metadata file, skip the import step. The migration below creates the tables, but a fresh database will naturally have no slot records.
Then apply the API’s supplemental tables and indexes:
npx wrangler d1 migrations apply voxelhttp-db --remote
For local development, use --local instead of --remote in both D1 commands. Start with a local import and test it before importing a large dump into the remote database.
Python Workers require Python 3.13 or newer and the python_workers compatibility flag. This project uses the official Python Workers ASGI adapter for FastAPI.
uv sync --dev
uv run pywrangler dev
Then test:
curl http://localhost:8787/v4/ping
curl 'http://localhost:8787/v5/slots/list/search?q=voxel&limit=10&offset=0'
curl 'http://localhost:8787/v6/slots/detail/00000000000000000000'
The last example returns null for a missing slot (assuming the ID passes the 20-digit validation rule).
npx wrangler deploy
Do not deploy until the D1 binding ID in wrangler.jsonc has been replaced.
limit must be 1..100; offset must be zero or greater. As in the source implementation, the page offset is multiplied by limit.mode query. The V6 search endpoint also accepts comma-separated tag values.slot.tags is stored as JSON text and parsed for the v6 detail/search responses.src/voxelhttp/worker.py — Worker FastAPI app and D1 query layersrc/voxelhttp/models/ — response/request models carried over from the originalmigrations/0001_schema.sql — tables and indexes used by the APIscripts/export_sqlite.py — SQLite-to-SQL export utility for importing upstream datawrangler.jsonc — Worker and D1 binding configuration