refactor: simplify app initialization by removing factory

Streamlined the Flask app setup by eliminating the factory function and directly initializing the app and registering blueprints in the global scope. This reduces complexity and improves readability. No functional changes introduced.
This commit is contained in:
Kumi 2024-09-19 19:03:44 +02:00
parent 7d208780aa
commit ceb49bc114
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -4,8 +4,6 @@ from os import environ
from .views import home, article, error, proxy
def create_app():
app = Flask(__name__)
app.register_blueprint(home.bp)
@ -13,11 +11,8 @@ def create_app():
app.register_blueprint(error.bp)
app.register_blueprint(proxy.bp)
return app
def main():
app = create_app()
port = int(environ.get("PORT", 8115))
app.run(port=port)