I want to connect (via API) an EC2 Microservice to Bubble forthe following use case:
User inputs data
Data is sent to EC2 from the Bubble API
The python scripts runs
the results are returned to Bubble API
Any tips on how to do it the most painless way, as i need to create multiple microservices for my app. I really suck at debugging the Bubble API, i always get different results to what i get in postman for example, so any tips will be appreciated.
I’ve done this. My approach was to create external endpoints and then use the api connector in Bubble to trigger various calculations, etc. Sometimes I return the results immediately to Bubble and in other cases, I queue up worker threads in python and then send a notification back to a Bubble endpoint with the results. For example, I built a CSV uploader where I have python parse the csv and return the column headers so users can map to bubble fields – then I trigger python to spin through the csv and create records in bubble using the data api.
It helps me get over any gaps in Bubble and is much better for data processing.
is there a best practice in some docs here on the authentication aspect? do the user-facing auth in Bubble, pass credentials or token over to the api so the api doesn’t do otherwise? I don’t really want to learn how to do oauth on the api writing side, but will do it if really needed.
My approach was to build as a plugin and this post from @emmanuel talks about securing token’s etc. as there are definitely good and bad ways to implement. You can secure your endpoint with http basic auth, or a token, or whatever else the api connector and your endpoint both support.
We’ve used Amazon Lambda for the same thing (instead of EC2). Lambda is designed for this use case so it works a bit better, is much cheaper, runs scripts without a database, and I believe works particularly well with Python.
Yes, and the best thing, the community is really great.
I could ask something about rocket science and someone will always be able to help, this is one of the best online communities i’ve been at, no kidding.