refactor 'app' to 'APP'

This commit is contained in:
Thomas Rubini 2023-01-03 16:59:42 +01:00
parent 03ab987f78
commit 9156793852
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373
3 changed files with 8 additions and 6 deletions

2
app.py
View File

@ -1,4 +1,4 @@
from truthseeker import app # the variable 'app' is detected by `flask run`
from truthseeker import APP as app # the variable 'app' is detected by `flask run`
if __name__ == "__main__":
app.run()

View File

@ -1,8 +1,8 @@
import json
import pytest
from truthseeker import app
from truthseeker import APP
test_app = app.test_client()
test_app = APP.test_client()
class TestException(Exception):
__test__ = False

View File

@ -29,7 +29,9 @@ class TruthSeekerApp(flask.Flask):
f.close()
print("Generated secret and wrote to secret.txt !")
app = TruthSeekerApp()
APP = TruthSeekerApp()
app.register_blueprint(routes_api.routes_api, url_prefix="/api/v1")
app.register_blueprint(routes_ui.routes_ui, url_prefix="/")
from truthseeker.routes import routes_api, routes_ui
APP.register_blueprint(routes_api.routes_api, url_prefix="/api/v1")
APP.register_blueprint(routes_ui.routes_ui, url_prefix="/")