Question

Best way to connect DigitalOcean App front to DigitalOcean App backend

Posted January 13, 2022 69 views
DigitalOcean App Platform

Hi!

I am fairly new to the web development and DO App platform. I’ve deployed my Django REST app on one DO App and Angular frontend on another one. Frontend connects to REST API via *.ondigitalocean.app address which was provided by DO for my Django app. It works but I guess it’s not the most optimal way to connect two DO Apps. Maybe there is some internal local address that I should use instead? Thank you!

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

On the app platform, you have components. If your frontend is one component, your django can be another component.

During the creation of a component, you’ll see a “HTTP Routes” on Step 3

In that case, you can set your frontend component to be / and then your django component to be /api

That way, your frontend, you only have to direct all requests to /api which will point to the django when you deploy.