Skip to content

Commit

Permalink
feat host config
Browse files Browse the repository at this point in the history
  • Loading branch information
a3510377 committed Mar 2, 2024
1 parent f996de8 commit 226909f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ConfigType(NamedTuple):
} # dict[name, UserAuth]
plugins_path: str = "plugins"
port: str = 8081
host: str = "localhost"


class Config(Generic[_RT]):
Expand Down
2 changes: 1 addition & 1 deletion server/core/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ async def start(self) -> web.AppRunner:
runner = web.AppRunner(self.app)
await runner.setup()
port = int(self.config.get("port", os.getenv("PORT")))
site = web.TCPSite(runner, "localhost", port)
site = web.TCPSite(runner, self.config.get("host", os.getenv("HOST")), port)
await site.start()

print(f"======= Serving on http://localhost:{port}/ ======")
Expand Down

0 comments on commit 226909f

Please sign in to comment.