23 lines
577 B
Python
23 lines
577 B
Python
import os
|
|
|
|
from flask import Flask
|
|
|
|
from app.services.auth_service import AuthService
|
|
|
|
|
|
def create_app():
|
|
"""Create and configure the Flask application."""
|
|
app = Flask(__name__)
|
|
|
|
# Configure session
|
|
app.config["SECRET_KEY"] = os.environ.get("SECRET_KEY", "dev-secret-key")
|
|
|
|
# Initialize authentication service
|
|
auth_service = AuthService(app)
|
|
|
|
# Register blueprints
|
|
from app.routes import main, auth
|
|
app.register_blueprint(main.bp, url_prefix="/api")
|
|
app.register_blueprint(auth.bp, url_prefix="/api/auth")
|
|
|
|
return app |