What is the preferred way to make the bap client aware of a reverse-proxy path prefix?
For example the bap is reachable under https://example.org/bap-client/index.html. When I configure the rest server connector like this:
import {configure as configurePlatformServerConnectors} from "@com.mgmtp.a12/bap-client/lib/extensions/platform-server-connectors";
// ...
const platformServerConnectors = configurePlatformServerConnectors({
serverURL: "/api",
localeProvider: () => Container.config.get<LocaleProvider>(Container.identifier.LocaleProvider).get(),
userProvider: () => {
if (config === undefined) {
throw new Error("broken setup");
}
return AuthenticationSelectors.user()(config.store.getState());
}
});
The bap would then contact the rest api via https://example.org/api/melies/SomeModel-overview. This fails because of the missing reverse-proxy path prefix.
The path prefix is only known from deployment on. The bap is deployed as a set of statically hosted files that were build before deployment. I want to support deploying the same artifact to many environments and hence different path prefixes.
So how do I make the rest server connextor aware of the path prefix?
Note that this seems somehow already being done for the sample application, which also uses path prefixes like in <INTERNAL_LINK> How is this done there?