Using Compute within an existing Python (Flask) backend

Hi,

I am always trying to get a grasp of the “big picture” first before I get into details. And I am still missing some very fundamental pieces of this puzzle (mainly because I am relatively new to this whole server-rest-api story). So my (high-level) question is:

We have an existing project (platform) and we are using Python/Flask for the backend. That works on some port (not 8081). I can then start the compute server following this example ( https://github.com/mcneel/compute.rhino3d/blob/master/docs/develop.md ) and now I have two servers running on two different ports. My guess is that in my Python/Flask project I could simply connect to Computer via:

compute_rhino3d.Util.url = “http://localhost:8081/

And then use Compute within our project. (I hope the answer to this is Yes, since this is not my question, and I haven’t tried this yet).

My question is simply if it is necessary to have two servers running on two ports like this? Is there a way to integrate Compute into our project somehow? Running both things at once on one server/port?

I know this is a very general question…but a simple Yes or No would help, and we can go into the details later.

Thanks!
Milos

1 Like

It’s commonplace to have multiple applications and services running on different ports and/or different machines to make up a single solution. What problems would integrating these two projects solve for you?