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
Copy file name to clipboardExpand all lines: src/fastapi_cli/cli.py
+3-16Lines changed: 3 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
importlogging
2
+
importos
2
3
frompathlibimportPath
3
4
fromtypingimportAnnotated, Any
4
5
@@ -300,13 +301,6 @@ def dev(
300
301
help="Comma separated list of IP Addresses to trust with proxy headers. The literal '*' means trust everything."
301
302
),
302
303
] =None,
303
-
public_url: Annotated[
304
-
str|None,
305
-
typer.Option(
306
-
help="The public URL where the server is accessible. Used for the URLs printed at startup. Defaults to [blue]http://HOST:PORT[/blue] from [bold]--host[/bold] and [bold]--port[/bold].",
307
-
envvar="FASTAPI_PUBLIC_URL",
308
-
),
309
-
] =None,
310
304
) ->Any:
311
305
"""
312
306
Run a [bold]FastAPI[/bold] app in [yellow]development[/yellow] mode. 🧪
@@ -345,7 +339,7 @@ def dev(
345
339
command="dev",
346
340
proxy_headers=proxy_headers,
347
341
forwarded_allow_ips=forwarded_allow_ips,
348
-
public_url=public_url,
342
+
public_url=os.getenv("FASTAPI_PUBLIC_URL"),
349
343
)
350
344
351
345
@@ -415,13 +409,6 @@ def run(
415
409
help="Comma separated list of IP Addresses to trust with proxy headers. The literal '*' means trust everything."
416
410
),
417
411
] =None,
418
-
public_url: Annotated[
419
-
str|None,
420
-
typer.Option(
421
-
help="The public URL where the server is accessible. Used for the URLs printed at startup. By default, the printed URLs use the configured host and port.",
422
-
envvar="FASTAPI_PUBLIC_URL",
423
-
),
424
-
] =None,
425
412
) ->Any:
426
413
"""
427
414
Run a [bold]FastAPI[/bold] app in [green]production[/green] mode. 🚀
0 commit comments