I have a simple FastAPI application that serves a file test.html
in app/main.py
like so:
@app.get('/')
def index():
return FileResponse('static/test.html')
The directory structure is like so:
app/main.py
app/static/test.html
Can I change this do that it works with a modified directory structure where app/
and static/
are siblings?
I have tried return FileResponse('../static/test.html')
but that has not worked so far; the resulting error is "RuntimeError: File at path ../static/test.html does not exist."