How to connect ANGULAR with Python via FLASK and CORS

ANGULAR JS



 $http.defaults.headers.post['Content-Type'] = 'application/json';

    $scope.dataa={ 'email' :  'fe','password' :  '12' };

    $http({
        url: 'http://91.134.193.166:5000/',
        method: "POST",
        headers: { 'Content-Type': 'application/json' },
        data: JSON.stringify($scope.dataa)
    })
        .then(function(response) {
            $scope.content = response.data;
                alert(response.data.title);
        },
        function(response) { // optional
             alert( response.data);
        });

PYTHON / FLASK



import json

from flask import Flask, request
from flask_cors import CORS
app = Flask(__name__)
CORS(app)

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

def write():
    post = request.get_json()
    param = post.get('email')
    with open('/var/www/html/topzapp/Python/somefile.txt', 'w') as the_file:
        the_file.write(param)
    return '{"title": "Person"}'