forked from avikaprasad22/genescope_backend
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.py
More file actions
22 lines (17 loc) · 751 Bytes
/
app.py
File metadata and controls
22 lines (17 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from flask import Flask
from flask_cors import CORS
from api.illumina import illumina_api # Your Blueprint
app = Flask(__name__)
# ✅ CORS: This allows requests from your frontend
CORS(app, origins=["http://127.0.0.1:4504"], supports_credentials=True)
@app.after_request
def apply_cors_headers(response):
response.headers["Access-Control-Allow-Origin"] = "http://127.0.0.1:4504"
response.headers["Access-Control-Allow-Credentials"] = "true"
response.headers["Access-Control-Allow-Headers"] = "Content-Type"
response.headers["Access-Control-Allow-Methods"] = "GET, POST, OPTIONS"
return response
# ✅ Register your API routes
app.register_blueprint(illumina_api)
if __name__ == '__main__':
app.run(debug=True, port=8504)