How to change the base path? #2964
-
https://docs.litestar.dev/2/reference/app.html#litestar.app.Litestar How can I change the base path from |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Just add your route handlers to a api_router = Router(path="/api", route_handlers=...)
app = Litestar(route_handlers=[api_router]) |
Beta Was this translation helpful? Give feedback.
-
The litestar app object accepts |
Beta Was this translation helpful? Give feedback.
Just add your route handlers to a
Router
instead of toLitestar
directly. Then you can change the base path there for everything except the/schema
: