We are setting up a gateway application, that takes a path /nerannotations and relays response from prodigy instance hosted in a subdomain based URL like https://nerannotations.prodigy.example.com/.
we want the request to go to http://localhost:8080/nerannotations/bundle.js so the gateway will get response from correct prodigy instance for all requests made with path /nerannotations.
how do we set a context path like /nerannotations to a prodigy instance?
Currently there's no way to define the context path via Prodigy configuration (and we are now considering adding a config or env variable for it). However, you can specify the root_path argument to FastAPI app object directly in the source code.
If you navigate to your prodigy installation directory > prodigy > app.py on line 200 there you can add the root path like so:
This root_path is like such context path that will be used to prefix all the routes defined in the app.
Please see FastAPI docs for more details on how it works and examples.
I quickly tested it with the local Prodigy instance (http://127.0.0.1:8000) and treafik proxy using the following treafik.toml: