Skip to content

Commit

Permalink
Update tutorial text
Browse files Browse the repository at this point in the history
  • Loading branch information
ppommer committed May 30, 2024
1 parent e0c7e35 commit 79462c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/tutorial/fastapi/simple-hero-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ And then create an `app` object that is an instance of that `FastAPI` class:

We want to make sure that once the app starts running, the function `create_tables` is called. To create the database and tables.

This should be called only once at startup, not before every request, so we put it in the function to handle the `"startup"` event:
This should be called only once at startup, not before every request. We define this startup logic using the lifespan parameter of the FastAPI app. The input for this parameter is an async function lifespan() which yields after calling `create_db_and_tables`.

//// tab | Python 3.10+

Expand Down

0 comments on commit 79462c5

Please sign in to comment.