Skip to content

fastapi.run should be able to take arguments from cli  #128

Description

@danilovmy

right now i should add some parameters directly in code:

@app.command(help="Run a FastAPI application.")
def run(prod: bool = typer.Option(False)):
    ....
    if not prod:
        # args.append("--reload")
        args.append("--log-level debug")
        args.append("--host 0.0.0.0")
        args.append("--port 8000")
        args.append("--access-log") 
    ....

But it is really standard and user-friendly to do, for example:

fastapi run --host 0.0.0.0 --port 7070

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions