Debian Codegraph @

docs/examples/application_state/passing_initial_state.py

raw
1 from typing import Any, Dict
2
3 from litestar import Litestar, get
4 from litestar.datastructures import State
5
6
7 @get("/", sync_to_thread=False)
8 def handler(state: State) -> Dict[str, Any]:
9 return state.dict()
10
11
12 app = Litestar(route_handlers=[handler], state=State({"count": 100}))