Resolve "Fix docs/api endpoint when running behind a proxy with extra path"
Closes #105 (closed)
Adds a configuration property APPLICATION_ROOT_PATH
read from .env
. Said property has a default value in config.py::EnvConfig
:
application_root_path: str = ""
To test
- Start opmet-backend with the current configuration.
- See that http://localhost:8000/api responds with the API docs, and http://localhost:8000/opmet/api responds with JSON
detail: "Not Found"
. - Add
APPLICATION_ROOT_PATH="/opmet"
in.env
. - Restart the backend.
- See that http://localhost:8000/opmet/api now responds with the API docs.