diff options
author | zsloan | 2021-10-12 20:56:31 +0000 |
---|---|---|
committer | zsloan | 2021-10-12 20:56:31 +0000 |
commit | 6e211182354fb4d6941e3a44ec1ec9d378b0e4ef (patch) | |
tree | 60d9aaf382eefbb47cdbab9c74d98481cf0983de /gn3/app.py | |
parent | b815236123ff8e144bd84f349357a1852df95651 (diff) | |
parent | 77c274b79c3ec01de60e90db3299763cb58f715b (diff) | |
download | genenetwork3-6e211182354fb4d6941e3a44ec1ec9d378b0e4ef.tar.gz |
Merge branch 'main' of https://github.com/genenetwork/genenetwork3 into bug/fix_rqtl_covariates
Diffstat (limited to 'gn3/app.py')
-rw-r--r-- | gn3/app.py | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -3,13 +3,17 @@ 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""" @@ -17,6 +21,12 @@ def create_app(config: Union[Dict, str, None] = None) -> Flask: # 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') @@ -30,6 +40,8 @@ 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") return app |