One Uplink Server, Many Anvil Apps

You could create one AwsUplink app with the uplink server and with a few server functions that interact with it.

Then you set AwsUplink as dependency of all your other apps, so they all can user the uplink.

I don’t know whether the dependent apps can call directly the uplink functions or the callables of the dependency, I doubt it. But you can create a function on the dependency, import that in the dependent app and call it.

# uplink_server.py on AWS
@anvil.server.callable
def uplink_function():
    pass

# on AwsUplink.ServerModule
def call_uplink_function():
    return uplink_function()

# on any dependent app
from AwsUplink.ServerModule import call_uplink_function
call_uplink_function()

I have not tried all of this, so it may need some tweaking, but the concept should work.

1 Like