Report this

What is the reason for this report?

How to call an App from another service / app?

Posted on November 24, 2020
hamy

By hamy

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.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.