Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (16.4k points)

I'm utilizing Angular8 + Firebase + Python (Flask) for my undertaking (Project). Rather than utilizing Rest API, we are performing CRUD activity like this:

I just want to know how to call the python function using Angular?

1 Answer

0 votes
by (26.4k points)
edited by

You can join Angular + Flask and use Flask as an API to perform CRUD tasks with Firebase. This is under the suspicion that you realize how to perform CRUD activities utilizing python. This is under the presumption that you likewise realize how to buy into the aftereffects of API and use it in the Angular application.

proxy.conf.json:

{

    "/api": {

        "target": "http://0.0.0.0:8081",    //set this to your flask port and address

        "secure": false

    }

}

package.json:

"scripts": {

        "ng": "ng",

        "start": "ng serve --proxy-config proxy.conf.json"

    },

flask.py:

@app.route('/api/getcvalue', methods=['GET','POST'])

def getC():

    # get parameters from request

    parameters = request.get_json()

    return jsonify({'C': parameters['C']})

Want to become an expert in Python? Join the python course fast!

If you wish to know Angular in-depth and get certified in it? Then have a look at the Angular Course from Intellipaat!

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...