-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (26 loc) · 871 Bytes
/
Copy pathmain.py
File metadata and controls
38 lines (26 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from flask import Flask, jsonify
from flask_cors import CORS
from dotenv import load_dotenv
from app.infrastructure.container import Container
from app.adapters.http.notification_blueprint import bp as notifications_bp
import logging
load_dotenv()
logging.basicConfig(level=logging.INFO)
def create_app() -> Flask:
app = Flask(__name__)
# CORS — permite llamadas desde cualquier origen (interfaz en Vercel)
CORS(app)
container = Container()
app.extensions["container"] = container
app.register_blueprint(notifications_bp)
@app.get("/")
def health():
return jsonify({
"status": "ok",
"project": "Python - Flask Hexagonal Architecture",
"channels": ["email", "sms", "in_app"]
})
return app
app = create_app()
if __name__ == "__main__":
app.run(debug=True, port=5000)