Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danilovmy opened this issue Jun 24, 2023 · 0 comments
Open

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

danilovmy opened this issue Jun 24, 2023 · 0 comments

Comments

@danilovmy
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant