You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
help="A path to a Python file or package directory (with [blue]__init__.py[/blue] files) containing a [bold]FastAPI[/bold] app. If not provided, a default set of paths will be tried."
200
+
help="A path to a Python file or package directory (with [blue]__init__.py[/blue] files) containing a [bold]FastAPI[/bold] app or app factory. If not provided, a default set of paths will be tried."
199
201
),
200
202
] =None,
201
203
*,
@@ -250,6 +252,12 @@ def dev(
250
252
help="Comma separated list of IP Addresses to trust with proxy headers. The literal '*' means trust everything."
251
253
),
252
254
] =None,
255
+
factory: Annotated[
256
+
bool,
257
+
typer.Option(
258
+
help="Treat [bold]path[bold] as an application factory, i.e. a () -> <ASGI app> callable."
259
+
),
260
+
] =False,
253
261
) ->Any:
254
262
"""
255
263
Run a [bold]FastAPI[/bold] app in [yellow]development[/yellow] mode. 🧪
@@ -287,6 +295,7 @@ def dev(
287
295
command="dev",
288
296
proxy_headers=proxy_headers,
289
297
forwarded_allow_ips=forwarded_allow_ips,
298
+
is_factory=factory,
290
299
)
291
300
292
301
@@ -356,6 +365,12 @@ def run(
356
365
help="Comma separated list of IP Addresses to trust with proxy headers. The literal '*' means trust everything."
357
366
),
358
367
] =None,
368
+
factory: Annotated[
369
+
bool,
370
+
typer.Option(
371
+
help="Treat [bold]path[bold] as an application factory, i.e. a () -> <ASGI app> callable."
372
+
),
373
+
] =False,
359
374
) ->Any:
360
375
"""
361
376
Run a [bold]FastAPI[/bold] app in [green]production[/green] mode. 🚀
0 commit comments