about summary refs log tree commit diff
path: root/gn3/app.py
diff options
context:
space:
mode:
authorAlexander Kabui2021-09-27 16:09:46 +0300
committerAlexander Kabui2021-09-27 16:09:46 +0300
commit62054d914efb4322fba311f968cb27b662aa6806 (patch)
treef904231c44d87db36e9b794f57373daf6508a11c /gn3/app.py
parent6f25b8e2b1d1a34c054d325b1c37b303529b8827 (diff)
parent0cbb6ecde0315b7d6f021cb17406f5e5197e8a05 (diff)
downloadgenenetwork3-62054d914efb4322fba311f968cb27b662aa6806.tar.gz
fix merge conflicts
Diffstat (limited to 'gn3/app.py')
-rw-r--r--gn3/app.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/gn3/app.py b/gn3/app.py
index b2f77f9..a25332c 100644
--- a/gn3/app.py
+++ b/gn3/app.py
@@ -3,21 +3,30 @@ import os
 
 from typing import Dict
 from typing import Union
+
 from flask import Flask
+from flask_cors import CORS # type: ignore
+
 from gn3.api.gemma import gemma
 from gn3.api.rqtl import rqtl
 from gn3.api.general import general
+from gn3.api.heatmaps import heatmaps
 from gn3.api.correlation import correlation
 from gn3.api.data_entry import data_entry
 from gn3.api.wgcna import wgcna
 
-
 def create_app(config: Union[Dict, str, None] = None) -> Flask:
     """Create a new flask object"""
     app = Flask(__name__)
     # Load default configuration
     app.config.from_object("gn3.settings")
 
+    CORS(
+        app,
+        origins=app.config["CORS_ORIGINS"],
+        allow_headers=app.config["CORS_HEADERS"],
+        supports_credentials=True, intercept_exceptions=False)
+
     # Load environment configuration
     if "GN3_CONF" in os.environ:
         app.config.from_envvar('GN3_CONF')
@@ -31,6 +40,7 @@ def create_app(config: Union[Dict, str, None] = None) -> Flask:
     app.register_blueprint(general, url_prefix="/api/")
     app.register_blueprint(gemma, url_prefix="/api/gemma")
     app.register_blueprint(rqtl, url_prefix="/api/rqtl")
+    app.register_blueprint(heatmaps, url_prefix="/api/heatmaps")
     app.register_blueprint(correlation, url_prefix="/api/correlation")
     app.register_blueprint(data_entry, url_prefix="/api/dataentry")
     app.register_blueprint(wgcna, url_prefix="/api/wgcna")