Skip to content

Commit

Permalink
feat: add support for custom server address
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-awd committed Sep 16, 2024
1 parent fb12ea4 commit 0b1e798
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
from pathlib import Path

import streamlit.web.cli as stcli
from pydantic_settings import BaseSettings


class StreamlitConfig(BaseSettings):
browser_server_address: str = "localhost"


def resolve_path(path: str) -> str:
Expand All @@ -11,11 +16,12 @@ def resolve_path(path: str) -> str:


if __name__ == "__main__":
config = StreamlitConfig()
sys.argv = [
"streamlit",
"run",
resolve_path("webapp/app.py"),
"--browser.serverAddress=localhost",
f"--browser.serverAddress={config.browser_server_address}",
"--browser.gatherUsageStats=false",
"--client.toolbarMode=viewer",
"--global.developmentMode=false",
Expand Down

0 comments on commit 0b1e798

Please sign in to comment.