Skip to content

get_default_path

fastagency.cli.discover.get_default_path #

get_default_path() -> Path
Source code in fastagency/cli/discover.py
def get_default_path() -> Path:
    potential_paths = (
        "main.py",
        "app.py",
        "api.py",
        "app/main.py",
        "app/app.py",
        "app/api.py",
    )

    for full_path in potential_paths:
        path = Path(full_path)
        if path.is_file():
            return path

    raise FastAgencyCLIError(
        "Could not find a default file to run, please provide an explicit path"
    )