Runnable examples
The repository ships three examples that progress across the current public surface. Clone the repository and prepare its development environment:
git clone https://github.com/tugrulguner/dexpot.gitcd dexpotuv sync --all-extrasMinimal typed route
Section titled “Minimal typed route”examples/minimal.py demonstrates a typed integer path capture and msgspec response.
uv run python examples/minimal.pycurl -s http://127.0.0.1:8000/items/7{"id":7,"name":"item-7","price":7.0}Typed CRUD
Section titled “Typed CRUD”examples/typed_crud.py demonstrates typed JSON bodies, compiled response encoders, status/payload returns, and thread-safe shared application state.
uv run python examples/typed_crud.pycurl -s -X POST http://127.0.0.1:8000/items \ -H 'Content-Type: application/json' \ -d '{"name":"keyboard","price":79.0}'The lock in this example belongs to the application. It protects the mutable dictionary when handlers execute concurrently.
Bounded API
Section titled “Bounded API”examples/bounded_api.py customizes HttpLimits and exercises 413, 422, and 405 responses plus typed Request injection.
uv run python examples/bounded_api.pycurl -s http://127.0.0.1:8000/healthcurl -s http://127.0.0.1:8000/contextThe test suite launches every example as a subprocess and validates its public HTTP behavior. Set DEXPOT_EXAMPLE_PORT when port 8000 is occupied.
Read the complete examples guide and source files in the repository.