Skip to content

Commit c8b5d2e

Browse files
feat: forward more cli options
1 parent 6cfb68a commit c8b5d2e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

packages/uvicorn-hmr/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uvicorn-hmr"
3-
version = "0.0.2.2"
3+
version = "0.0.3"
44
readme = "README.md"
55
dependencies = [
66
"hmr~=0.2.0",

packages/uvicorn-hmr/uvicorn_hmr.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77

88

99
@app.command(no_args_is_help=True)
10-
def main(slug: str = Argument("main:app"), reload_include: str = str(Path.cwd()), reload_exclude: str = ".venv"):
10+
def main(
11+
slug: str = Argument("main:app"),
12+
reload_include: str = str(Path.cwd()),
13+
reload_exclude: str = ".venv",
14+
host: str = "localhost",
15+
port: int = 8000,
16+
env_file: Path | None = None,
17+
log_level: str | None = "info",
18+
):
1119
if ":" not in slug:
1220
secho("Invalid slug: ", fg="red", nl=False)
1321
secho(slug, fg="yellow")
@@ -50,7 +58,7 @@ def stop_server():
5058
def start_server(app: "ASGIApplication"):
5159
nonlocal stop_server
5260

53-
server = Server(Config(app, host="localhost"))
61+
server = Server(Config(app, host, port, env_file=env_file, log_level=log_level))
5462
finish = Event()
5563

5664
def run_server():

0 commit comments

Comments
 (0)