Consuming API - changing URL in different environments
Hi, I have created a API and want to consume it, when running it on local it is http://localhost<port>/v1/api and when checking alpha/beta it is http://<alpha/betaUrl>/v1/api. I want to consume this in another module of same project, how would I go about calling this api in Microflow, without changing the first part of URL? Do I have to get browser url and append v1/api to it?
I would say there are two ways how you could tackle this:
Move the url host part to a mendix constant and change this constant in your different environments
Get the host/url of your application via the “Get Application URL” action from the Community Commons.
Cant you simply make a sub microflow of your API action and call that with proper security permissions across modules? Do you really want to do this by calling webservice within the same project. Hope you understand the side-effects of this design.