I am planning on building a system that requires apps to call each other via http requests and am trying to figure out how to get two apps to call each other. From the API reference (https://developers.digitalocean.com/documentation/v2/#retrieve-an-existing-app) it seems this may be possible by:

  1. querying the DO api for the desired app
  2. parsing out the ‘live_url’
  3. calling the parsed url

But I wanted to see if there was a best practice somewhere that was different.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

If the two services are part of the same site, you might consider putting both services in the same application. Service components in the same app can communicate over a local network using the component name as the address. For example, if your app has two services, api and web, web can reach api at http://api:80. Public services will always be exposed internally on port 80. These internal requests don’t count against the bandwidth utilization for an app, while requests from one app to another app’s public URL will.