Open C-Duv opened 1 year ago
I've just started a simple patch to address this issue: I'll check/test it later and submit a PR if it's working just fine.
I fail to achieve what I want.
Using app = FastAPI(title=app_settings.PROJECT_NAME, root_path="/the_api")
:
https://server.example.com/the_api/docs
👍openapi.json
from https://server.example.com/the_api/openapi.json
👍But paths in openapi.json
lacks the /the_api
prefix so Swagger UI is not working. 😓
The more I dig the more I'm not really sure FastAPI can prefix URLs in openapi.json
.
There are ideas in this FastAPI issue https://github.com/tiangolo/fastapi/issues/829 I need to try.
Any progress here @C-Duv ? I am having a similar issue.
No, I failed to find the correct settings or hack so I ended up using a dedicated FQDN for the API.
Could the application be configured to run under a specific URL path.
Say I want to make it available at URL
https://monitoring.example.com/uptime-api/
I can, from my web reverse proxy, strip the
/uptime-api
part prior to passing it to the Docker container running themedaziz11/uptimekuma_restapi
image. But in the obtained response contains URL that refers to the root of the server.Thus, when I try to access
https://monitoring.example.com/uptime-api/
, I get alocation: /docs
HTTP 307 response.If I try to access https://monitoring.example.com/uptime-api/docs, I get the correct HTML document but it asks for
/openapi.json
, nothttps://monitoring.example.com/uptime-api/openapi.json
.If there was some configuration/option to declare the path the application is expected to execute from it would be useful.
(I guess can submit a PR for this)