I'm trying to have FastAPI work with Svelte. I've built the static files with Svelte and now I'm trying to serve them from FastAPI. The problem is that the built Svelte files reference e.g. global.css
from root, which means I can't have them mounted on a subfolder.
Instead, I have to mount them on root:
app.mount("/", StaticFiles(directory="web/public", html=True), name="web")
However, this makes anything defined in routes (function decorators) inaccessible.
Is it possible have either both static files and functions defined? Either,
a) routes take precedence and if there's no route, it tries to read from static directories
b) static directories take precedence, and I specify an exclude path, which goes to routes instead