How to reference External API to point to localhost

1
0
-1

Hi,

I have my variables as external API pointing to http://localhost:xxxx/rest_command
When I access the bonita application pages directly from this server I get the data right, since the service xxxx is running in this server.
When I do it from a browser in other pc, it retrieves nothing.

It looks like it is doing the localhost in the client where the application page is opened, thus retrieving nothing since there is no service xxxx there.
If I point the variable to http://server_name_or_ip/rest_command, it works fine.

Is there a way to refer to the own server so I don't need to change all the server references, when going productive ?

Thanks
Afotav

1 answer

1
+1
-1

Use ../api/command

That should do it.

It should reference the server correctly

regards
Seán

PS: As this reply answers your question, please mark as resolved.

Comments

Submitted by afotav on Tue, 07/04/2017 - 00:14

Hi Sean,

I am using a Postgres server, with a REST addon.
For normal tables it works to reference something like ../API/bdm/BusinessData/com.company.model.Table?p=0&c=5&q=find
However I need to address a view with some field filters, and I've tried some flavors of this syntax, without success.
Example:
../API/bdm/BusinessData/com.company.model.View?f=Field1=value&f=Field2=value

Do you think this should really work in Bonita ? If so I'll keep on trying.

Thanks,

Afo.

Submitted by afotav on Thu, 07/06/2017 - 02:20

The only way I could do that for Views in a Postgres database, was to use the absolute host name like http://servername:xxx/REST_COMMAND.
It's a pain, when one has to switch server name...

Thanks.

Notifications