Skip to content

Commit

Permalink
cors - 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sasi2312 committed May 30, 2024
1 parent fc55902 commit 7b821d7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
re.compile(r'^/issues/[^/]+/[^/]+$') # Matches '/issues/<owner>/<issue>'
]

@cross_origin() # added this to my endpoint
@app.route('/greeting', methods=['GET'])
@cross_origin() # added this to my endpoint
def greeting():
"""
A simple greeting endpoint.
Expand All @@ -56,8 +56,8 @@ def greeting():
}
return jsonify(response)

@cross_origin()
@app.route('/get-data', methods=['GET'])
@cross_origin()
def get_data():
"""
Fetch data from Supabase.
Expand Down Expand Up @@ -85,8 +85,8 @@ def get_data():
return jsonify({'error': str(e)}), 500


@cross_origin()
@app.route('/issues', methods=['GET'])
@cross_origin()
def get_issues():
"""
Fetch all issues and group by owner.
Expand Down Expand Up @@ -129,8 +129,8 @@ def get_issues():
except Exception as e:
return jsonify({'error': str(e)}), 500

@cross_origin()
@app.route('/issues/<owner>', methods=['GET'])
@cross_origin()
def get_issues_by_owner(owner):
"""
Fetch issues by owner.
Expand Down Expand Up @@ -170,8 +170,8 @@ def get_issues_by_owner(owner):



@cross_origin()
@app.route('/issues/<owner>/<issue>', methods=['GET'])
@cross_origin()
def get_issues_by_owner_id(owner, issue):
"""
Fetch issues by owner and issue number.
Expand Down

0 comments on commit 7b821d7

Please sign in to comment.