Skip to content

Commit

Permalink
fix: cross-origin
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekzyla committed Sep 16, 2022
1 parent 4a01627 commit f1946a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


@app.route('/')
@cross_origin(origin='*', headers=['access-control-allow-origin', 'Content-Type'])
def hello_world():
return 'Hello World!'

Expand Down Expand Up @@ -40,14 +41,14 @@ def get_profiles_list():


@app.route('/profiles/all')
@cross_origin(origin='*', headers=['access-control-allow-origin', 'Content-Type'])
@cross_origin()
def get_all_profiles_list():
profiles = db.profiles.find()
profiles_list = list(profiles)
print(profiles_list)
return json_util.dumps(profiles_list)


#@cross_origin(origin='*', headers=['access-control-allow-origin', 'Content-Type'])
@app.route('/profiles/add', methods=['POST'])
@cross_origin(origin='*', headers=['access-control-allow-origin', 'Content-Type'])
def add_profile_record():
Expand Down

0 comments on commit f1946a5

Please sign in to comment.