https://prefect.io logo
#prefect-community
Title
# prefect-community
o

Ofir

05/29/2022, 2:00 PM
And another unrelated question. Can anyone please explain the typical production integration with Prefect? Concretely speaking, I have a web MERN (MongoDB, Express.js, React, Node.js) stack, and I would like to attach/integrate my JavaScript Node.js code of REST APIs (e.g. POST /employees) with an existing Prefect DAG.
k

Kevin Kho

05/29/2022, 7:39 PM
If you are suggesting using Python to hit API endpoints in some order, yes this is what Prefect can do for you. If you are saying you have an app and based on user-input, you trigger a Prefect Flow (maybe to generate a report), yes this can be done by hitting the API of Cloud/Server. Or did you mean something else?
o

Ofir

05/30/2022, 7:52 AM
Thanks @Kevin Kho! Python would be perfect. I’m interested to see a “Hello World” sample of a Node.JS / Django backend that interacts with some dummy Prefect setup
Just to see the interaction between these two components. I will provide databases as example, so when I communicate with a PostgreSQL database from Node.JS then it is pretty clear, you have prisma npm library or mongoose for MongoDB, so there are ORM wrappers for the interaction. I am looking for the Prefect equivalent, like the glue code / shim layer that ties backend REST API controller and the Prefect code that is running.
k

Kevin Kho

05/30/2022, 4:28 PM
I have an example here that shows how to use the native Python requests library to start a flow run. It may give you a picture how to hit the API endpoint
o

Ofir

05/31/2022, 12:21 PM
Thanks a lot Kevin, this is highly appreciated!
2 Views