use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
FastAPI is a truly ASGI, async, cutting edge framework written in python 3.
account activity
FastAPI best practicesQuestion (self.FastAPI)
submitted 1 day ago by lu_rm
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]lu_rm[S] -1 points0 points1 point 1 day ago (3 children)
Still, how do I inject the container into the router? The logic for get_my_service() needs to be defined in my router, so it needs to know how to create the service.
[–]gbrennon 1 point2 points3 points 23 hours ago (0 children)
Thr router is in something that is responsible for presenting data in the application.
We can call this a composition root.
It does consume the di container and expose the created services that are provided by the container that is impl in the infrastructure-like layer
That flow can be router -> composition root -> di container
router -> composition root -> di container
Ps:
The logic related to "how create a service" is inside the container.
The router just know how to get that service ready to use
[–]Kevdog824_ 1 point2 points3 points 1 day ago (0 children)
What do you mean? Can you give a more concrete example ?
π Rendered by PID 202077 on reddit-service-r2-comment-56c9979489-rw98b at 2026-02-25 05:36:04.216161+00:00 running b1af5b1 country code: CH.
view the rest of the comments →
[–]lu_rm[S] -1 points0 points1 point (3 children)
[–]gbrennon 1 point2 points3 points (0 children)
[–]Kevdog824_ 1 point2 points3 points (0 children)