Replies: 1 comment 2 replies
-
How are you running the app? Sounds like you could make use of e.g. uvicorn's |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a litestar API behind a proxy (traefik). The API is served at /api/2 and the proxy is responsible to strip the path so litestar serve the API on the root path /. The API works fine.
The OpenAPI plugin are configured to be served at /docs. But the openapi plugin are searching at /docs/openapi.json for the schema instead of /api/2.
My HTTP proxy add the HTTP header X-Script-Name to the request header with the root URL server. How could I intercept this header to dynamically set the root path for the OpenAPI plugin? Is it possible?
For the moment, the only solution I see is to prevent the proxy to strip the root URL and statically tell Litestar it's root url behind /api/2. Is it possible to make this dynamic?
Beta Was this translation helpful? Give feedback.
All reactions