When I want to share my python script with colleagues to use, I made it a FastAPI app. It serves a front page as a simple interface in addition to API calls.
It runs fine locally. When I open url http://127.0.0.1:8000 or http://127.0.0.1:8000/index.html the front page shows. The docs page (http://127.0.0.1:8000/docs) also works
However once published to our Connect server, the front page does not show. docs page works though.
When I put the direct link URL in, the page is just blank; the same blank page happens to direct.url.link/index.html. (direct.url.link/docs shows the the API document as it should)
When I intentionally spell index.html wrong, like direct.url.link/index.htm, the page returns 'not found' response:
{
"detail": "Not Found"
}
which means the API works properly; but FastAPI served page does not.
Is this an issue with Connect Server config or the app needs to be modification to work properly?
It was the path in the index.html. On local machine, the absolute path in the form of /scripts/abc.js and /img/logo.png are OK. But on the Connect server they have to be relative paths like scripts/abc.js and img/logo.png. This makes sense when thinking about how Connect server serves individual apps.
Also it has to be through the direct link. I haven't found a way to make it work in the "content" page