Thread
#prefect-community
    Ofir

    Ofir

    3 months ago
    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.
    Kevin Kho

    Kevin Kho

    3 months ago
    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?
    Ofir

    Ofir

    3 months ago
    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.
    Kevin Kho

    Kevin Kho

    3 months ago
    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
    Ofir

    Ofir

    3 months ago
    Thanks a lot Kevin, this is highly appreciated!