Deploying to a folder / path on server


I want to deploy to a sub-folder URL / path on our server. Example: localhost/my_new_streamlit_app
Trying the following code fails:

Popen('streamlit run --server.port=8502 --server.address=localhost/streamlit', shell=True)

The reason I want to this is that we only have one domain with certificates on our internal network and many webapps, so I cannot use root or use many ports.

How could I add /folder_name to the server address?

I found the answer, just create a config.toml file located at users>username>.streamlit

In it you write:

# The base path for the URL where Streamlit should be served from.
# Default: ""
baseUrlPath = "/subfolder"

Or better yet:

Popen(“streamlit run --server.baseUrlPath=/dp_element”, shell=True)