R

Ravina • 3.96K Points
Extraordinary

Q. How can you define global dependencies for all routes in FastAPI?

  • (A) Using `Depends()` on each function
  • (B) Using `app.add_dependency()`
  • (C) Passing `dependencies` list to FastAPI constructor
  • (D) Using `global_dependencies()`
  • Correct Answer - Option(C)
  • Views: 20
  • Filed under category Fast API
  • Hashtags:

Explanation by: Ravina
Global dependencies can be passed via the `dependencies` parameter to the FastAPI constructor.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.