FerrellSyntheticIntelligence
Add understanding engine, conversation interface, meditation engine, unified launcher
7d9e142 | import os | |
| from flask import Flask, jsonify | |
| from flask_cors import CORS | |
| from extensions import db | |
| from auth import auth_bp | |
| def create_app(config: dict = None) -> Flask: | |
| app = Flask(__name__) | |
| app.config["SQLALCHEMY_DATABASE_URI"] = os.getenv( | |
| "DATABASE_URL", "sqlite:///vitalis.db" | |
| ) | |
| app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False | |
| app.config["SECRET_KEY"] = os.getenv("SECRET_KEY", "dev-secret-change-me") | |
| if config: | |
| app.config.update(config) | |
| CORS(app, resources={r"/api/*": {"origins": "*"}}) | |
| db.init_app(app) | |
| # Register blueprints | |
| app.register_blueprint(auth_bp) | |
| def not_found(e): | |
| return jsonify({"error": "Not found"}), 404 | |
| def server_error(e): | |
| return jsonify({"error": "Internal server error"}), 500 | |
| def health(): | |
| return jsonify({"status": "ok", "service": "vitalis-api"}) | |
| with app.app_context(): | |
| db.create_all() | |
| return app | |
| if __name__ == "__main__": | |
| app = create_app() | |
| app.run(debug=os.getenv("FLASK_DEBUG", "1") == "1", port=5000) | |