Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/en/docs/fastapi-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,21 @@ which would be equivalent to:
from backend.main import app
```

### `fastapi dev` with path { #fastapi-dev-with-path }
### `fastapi dev` with path or with `--entrypoint` CLI option { #fastapi-dev-with-path-or-with-entrypoint-cli-option }

You can also pass the file path to the `fastapi dev` command, and it will guess the FastAPI app object to use:

```console
$ fastapi dev main.py
```

But you would have to remember to pass the correct path every time you call the `fastapi` command.
Or, you can also pass the `--entrypoint` option to the `fastapi dev` command:

```console
$ fastapi dev --entrypoint main:app
```

But you would have to remember to pass the correct path\entrypoint every time you call the `fastapi` command.

Additionally, other tools might not be able to find it, for example the [VS Code Extension](editor-support.md) or [FastAPI Cloud](https://fastapicloud.com), so it is recommended to use the `entrypoint` in `pyproject.toml`.

Expand Down
10 changes: 8 additions & 2 deletions docs/en/docs/tutorial/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,21 @@ which would be equivalent to:
from backend.main import app
```

### `fastapi dev` with path { #fastapi-dev-with-path }
### `fastapi dev` with path or with `--entrypoint` CLI option { #fastapi-dev-with-path-or-with-entrypoint-cli-option }

You can also pass the file path to the `fastapi dev` command, and it will guess the FastAPI app object to use:

```console
$ fastapi dev main.py
```

But you would have to remember to pass the correct path every time you call the `fastapi` command.
Or, you can also pass the `--entrypoint` option to the `fastapi dev` command:

```console
$ fastapi dev --entrypoint main:app
```

But you would have to remember to pass the correct path\entrypoint every time you call the `fastapi` command.

Additionally, other tools might not be able to find it, for example the [VS Code Extension](../editor-support.md) or [FastAPI Cloud](https://fastapicloud.com), so it is recommended to use the `entrypoint` in `pyproject.toml`.

Expand Down
Loading