Skip to content

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

  1. Start opmet-backend with the current configuration.
  2. See that http://localhost:8000/api responds with the API docs, and http://localhost:8000/opmet/api responds with JSON detail: "Not Found".
  3. Add APPLICATION_ROOT_PATH="/opmet" in .env.
  4. Restart the backend.
  5. See that http://localhost:8000/opmet/api now responds with the API docs.

Merge request reports

Loading