Skip to content

Commit

Permalink
Merge pull request #289 from AKVorrat/feature/listen-address
Browse files Browse the repository at this point in the history
Add --host CLI option
  • Loading branch information
scy authored Dec 14, 2024
2 parents 3d5a658 + 19434ee commit 9fdf8a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/dearmep/cli/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@


DEFAULT_PORT = 8000
DEFAULT_HOST = "127.0.0.1"
LOG_LEVELS = ("critical", "error", "warning", "info", "debug")
DEFAULT_LOG_LEVEL = "info"

Expand All @@ -26,6 +27,7 @@ def serve(ctx: Context) -> None:
"dearmep.main:create_app",
factory=True,
port=ctx.args.port,
host=ctx.args.host,
reload=ctx.args.reload,
reload_excludes=["node_modules"], # TODO: doesn't seem to be working
log_config=ctx.args.log_config,
Expand Down Expand Up @@ -57,6 +59,12 @@ def add_parser(
help=f"TCP port number to use (default: {DEFAULT_PORT})",
)

parser.add_argument(
"--host",
default=DEFAULT_HOST,
help=f"TCP host address to bind to (default: {DEFAULT_HOST})",
)

parser.add_argument(
"--reload",
action="store_true",
Expand Down

0 comments on commit 9fdf8a8

Please sign in to comment.