Hello SAP experts,
we have the requirement to dynamically switch the destination of API calls. Mainly for ODATA servcies called by SAPUI5 applications running on SAP BTP.
The destination should be switched either based on user preferences or a decision matrix.
I think an standalone application router would be a good place to do that.
In the beforeRequestHandler i'm able to get the loggged in user and could execute a call to an endpoint who delivers the right destination. With that info I want to change the router configuration.
But I didn't find a possibility to set the this in the beforeRequestHandler.
Only over an own getRouterConfig function I was able to do it, but in the function I do not have the information of the user in the request.
As well there were 2 notices in the documentation:
1. Note: When approuter is bound to html5 repository, you cannot provide getRouterConfig function.
2. beforeRequestHandler would be the best place to call a service
Does anybody know how to do that?
Is the approuter the right place for that?