Skip to content

Commit

Permalink
fix(server): CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanzhi33 committed Jul 4, 2024
1 parent aa5b47e commit da263d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def cors_response(data):
return response


@app.route('/api/insert', methods=['POST'])
@app.route('/api/insert', methods=['POST', 'OPTIONS'])
def insert():
data = request.json
store.insert(data['user'], data['data'])
Expand All @@ -21,7 +21,7 @@ def insert():
'msg': 'success'
})

@app.route('/api/get', methods=['POST'])
@app.route('/api/get', methods=['POST', 'OPTIONS'])
def get():
data = request.json
if 'page' not in data or 'perPage' not in data:
Expand Down

0 comments on commit da263d8

Please sign in to comment.