From fd2384a294a4c73808a0414f24b30951bf80455d Mon Sep 17 00:00:00 2001 From: Aleksei Anatskii Date: Thu, 29 Aug 2024 15:49:35 +0400 Subject: [PATCH] HH-228148 emphasize on using wrapped router instead the fastapi one --- docs/routing.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/routing.md b/docs/routing.md index 78ec89c09..a06086888 100644 --- a/docs/routing.md +++ b/docs/routing.md @@ -1,7 +1,12 @@ ## Routing in Frontik applications On application start, frontik import all modules from {app_module}.pages so that any controller should be located there. -We use fastapi routing, read [these docs](https://fastapi.tiangolo.com/reference/apirouter/?h=apirouter) for details. A small important difference - you must inherit `frontik.routing.FastAPIRouter` instead `fastapi.APIRouter`. And use `from frontik.routing import router`, if you need default router. +We use fastapi routing, read [these docs](https://fastapi.tiangolo.com/reference/apirouter/?h=apirouter) for details. + +> [!IMPORTANT] +> Never inherit from the `fastapi.APIRouter` router directly, instead you should use wrapped alternative from [`frontik.routing.FastAPIRouter`](https://github.com/hhru/frontik/blob/526a4cc22d151694fa48439f884dd03a6ca2329f/frontik/routing.py#L110) +> +> If you won't customize router behaviour then simply import `from frontik.routing import router` example: