Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to change port from default 8501 #56

Open
bobbypage opened this issue Jan 29, 2025 · 1 comment
Open

Allow to change port from default 8501 #56

bobbypage opened this issue Jan 29, 2025 · 1 comment

Comments

@bobbypage
Copy link

It doesn't seem like preswald currently supports running on ports other than 8501.

As an example:

$ git clone https://github.com/StructuredLabs/preswald.git
$ cd /preswald/examples/network

$ preswald run hello.py --port 8000
Running 'hello.py' on http://localhost:8000 with log level INFO  🎉!
Starting Preswald server at http://localhost:8000
Using port 8501 from config.toml
Will run script: /preswald/examples/network/hello.py
INFO:     Started server process [487]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8501 (Press CTRL+C to quit)

I saw the message Using port 8501 from config.toml, so I assumed the the port is coming from the config. I adjusted the config:

root@40247a2e968d:/preswald/examples/network# cat config.toml
[project]
title = "Network Topology | Preswald"
version = "0.1.0"
port = 8000 <---

and trying again:

root@40247a2e968d:/preswald/examples/network# preswald run hello.py --port 8000
Running 'hello.py' on http://localhost:8000 with log level INFO  🎉!
Starting Preswald server at http://localhost:8000
Using port 8000 from config.toml
Will run script: /preswald/examples/network/hello.py
INFO:     Started server process [496]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8501 (Press CTRL+C to quit)

We see

Using port 8000 from config.toml

However, still seems like the port used by the server is 8501.

I would expect that the preference of the port would be:

  1. From the --port flag (if supplied)
  2. From the config.toml (if supplied)
  3. Default to some well known port like 8501
@amrutha97
Copy link
Member

Thanks! taking a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants