Cristobal299 commited on
Commit
01ac14b
·
verified ·
1 Parent(s): 4f30837

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -7,6 +7,13 @@ from flask import Flask, request, jsonify, g
7
 
8
  app = Flask(__name__)
9
 
 
 
 
 
 
 
 
10
  # ----------------------------------------------------------------------
11
  # Database utilities (unchanged)
12
  # ----------------------------------------------------------------------
 
7
 
8
  app = Flask(__name__)
9
 
10
+ @app.after_request
11
+ def add_cors_headers(response):
12
+ response.headers['Access-Control-Allow-Origin'] = '*'
13
+ response.headers['Access-Control-Allow-Methods'] = 'GET,POST,PUT,DELETE,OPTIONS'
14
+ response.headers['Access-Control-Allow-Headers'] = 'Content-Type,Authorization'
15
+ return response
16
+
17
  # ----------------------------------------------------------------------
18
  # Database utilities (unchanged)
19
  # ----------------------------------------------------------------------