Hello all, I would like to use Heroku for some back end functions, and connect them with my Anvil app using the Anvil uplink. Is there advice on how to do this, particularly on the Heroku end of things? What specifications would I need to make to the proc file? Also, do I need to import flask to use the uplink, or is this a web socket? Still pretty new to those aspects, so any help on understanding the process is greatly appreciated.
Hi @JonStewart51 and welcome to the Anvil Forum! It sounds as if you’re trying to do something specific, so it would be helpful to have a bit more information on what you’re after.
Is there a particular reason you’d like to use Heroku here?
Hi Hannah,
I am open to other platforms, but some potentially nice features of Heroku are that it is possible to push git code to production, and perhaps a bit more performant than just running a Jupyter notebook with uplink to handle those operations. (Jupyter notebooks are how I currently have tested uplink related functions fwiw.) I am open to other suggestions in terms of what to run that code on. Ideally, it has a file system and an ability to add libraries as needed, as well as a reasonable ability to handle concurrency if there are multiple requests in a short period of time.
Thanks for the clarification. It doesn’t sound as if Heroku will suit your needs - Heroku is set up to serve HTTP requests, so if you want to use something other than HTTP to connect with a backend on Heroku (ie Anvil’s Uplink) it’d be rather awkward.
There are two possible options for where you could run your backend code instead. The easiest way is to run your code in an Anvil Server Module - you get the advantage of quick integration with your Anvil app that way and won’t have to set up an Uplink. You can also push git code to production - every Anvil app is just a git repository of files, so you can easily check out your app, make changes locally and push the results to production.
Another option, if for some reason Server Modules don’t suit your needs, would be to host your Jupyter notebook code on something like an Amazon EC2 instance. You could run an Uplink in a notebook in the instance just as you have been doing locally,
Hope this helps!