MCPcopy
hub / github.com/fastapi/fastapi / FastAPI

Class FastAPI

fastapi/applications.py:42–4768  ·  view source on GitHub ↗

`FastAPI` app class, the main entrypoint to use FastAPI. Read more in the [FastAPI docs for First Steps](https://fastapi.tiangolo.com/tutorial/first-steps/). ## Example ```python from fastapi import FastAPI app = FastAPI() ```

Source from the content-addressed store, hash-verified

40
41
42class FastAPI(Starlette):
43 """
44 `FastAPI` app class, the main entrypoint to use FastAPI.
45
46 Read more in the
47 [FastAPI docs for First Steps](https://fastapi.tiangolo.com/tutorial/first-steps/).
48
49 ## Example
50
51 ```python
52 from fastapi import FastAPI
53
54 app = FastAPI()
55 ```
56 """
57
58 def __init__(
59 self: AppType,
60 *,
61 debug: Annotated[
62 bool,
63 Doc(
64 """
65 Boolean indicating if debug tracebacks should be returned on server
66 errors.
67
68 Read more in the
69 [Starlette docs for Applications](https://www.starlette.dev/applications/#instantiating-the-application).
70 """
71 ),
72 ] = False,
73 routes: Annotated[
74 list[BaseRoute] | None,
75 Doc(
76 """
77 **Note**: you probably shouldn't use this parameter, it is inherited
78 from Starlette and supported for compatibility.
79
80 ---
81
82 A list of routes to serve incoming HTTP and WebSocket requests.
83 """
84 ),
85 deprecated(
86 """
87 You normally wouldn't use this parameter with FastAPI, it is inherited
88 from Starlette and supported for compatibility.
89
90 In FastAPI, you normally would use the *path operation methods*,
91 like `app.get()`, `app.post()`, etc.
92 """
93 ),
94 ] = None,
95 title: Annotated[
96 str,
97 Doc(
98 """
99 The title of the API.

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…