How can i set url mapping to access resources in my streamlit app?

I have deployed my streamlit application to ubuntu server by:

~/project$ streamlit run src/main.py

And I can access my application by:

ip:port/

The structure of my project is like:

project/

resources/
src/

resources/

data/

a.json

src/

main.py
other/

The question now is, how can i access the resouces in my application by such url:

ip:port/resources/data/a.json
1 Like

Hey @siwei,

You could do something like this within your script:

import streamlit as st
import requests

json = requests.get("https://jsonplaceholder.typicode.com/todos/").json()

st.dataframe(json)