Skip to content

Commit

Permalink
Add --host CLI option
Browse files Browse the repository at this point in the history
So that the service can listen on other addresses than localhost.
This is especially relevant for running as a podman container.

Signed-off-by: Jörn Bethune <jörn@nospam.example.org>
  • Loading branch information
Jörn Bethune committed Dec 14, 2024
1 parent 3d5a658 commit cf4f9d0
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 @@ -26,6 +26,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 +58,13 @@ def add_parser(
help=f"TCP port number to use (default: {DEFAULT_PORT})",
)

parser.add_argument(
"--host",
type=str,
default="localhost",
help="local address on which the service listens",
)

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

0 comments on commit cf4f9d0

Please sign in to comment.