from litestar.response.redirect import Redirect import uvicorn from litestar import Litestar, get @get("/") async def index() -> Redirect: return Redirect("/schema/swagger") @get("/books/{book_id:int}") async def get_book(book_id: int) -> dict[str, int]: return {"book_id": book_id} if __name__ == "__main__": app = Litestar([index, get_book]) uvicorn.run(__name__ + ":app", port=5000, log_level="info")