aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2021-02-16 19:13:40 +0300
committerBonfaceKilz2021-02-16 19:13:40 +0300
commit8fe418159306c1d04e4a13a63a7cd2b5b52dd5d5 (patch)
tree0b585a49d5599ae0130416a2ec762d9bb58da512
parente2b150f89d58133c7ba3d769d66127a2ff037d92 (diff)
downloadgenenetwork3-8fe418159306c1d04e4a13a63a7cd2b5b52dd5d5.tar.gz
Register blueprints in gn3/app.py
* main.py: Move blueprint registrations to ... * gn3/app.py (create_app): ... here
-rw-r--r--gn3/app.py2
-rw-r--r--main.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/gn3/app.py b/gn3/app.py
index 9bdebc1..e9ce7f1 100644
--- a/gn3/app.py
+++ b/gn3/app.py
@@ -5,6 +5,7 @@ from typing import Dict
from typing import Union
from flask import Flask
+from gn3.api.gemma import gemma
def create_app(config: Union[Dict, str, None] = None) -> Flask:
"""Create a new flask object"""
@@ -22,4 +23,5 @@ def create_app(config: Union[Dict, str, None] = None) -> Flask:
app.config.update(config)
elif config.endswith(".py"):
app.config.from_pyfile(config)
+ app.register_blueprint(gemma, url_prefix="/gemma")
return app
diff --git a/main.py b/main.py
index 8b2fa73..e3ca41a 100644
--- a/main.py
+++ b/main.py
@@ -1,9 +1,7 @@
"""Main entry point for project"""
from gn3.app import create_app
-from gn3.api.gemma import gemma
app = create_app()
-app.register_blueprint(gemma, url_prefix="/gemma")
app.run(host="0.0.0.0")