forked from iammafah/SocialCore-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
32 lines (22 loc) · 576 Bytes
/
app.py
File metadata and controls
32 lines (22 loc) · 576 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
from flask import Flask
from flask_cors import CORS
from database.db import db, migrate
from config import Config
from routes.api import api_bp
def create_app():
app = Flask(__name__)
app.config.from_object(Config)
CORS(app) # 🔥 allow browser requests
db.init_app(app)
migrate.init_app(app, db)
@app.route("/")
def health():
return {"status": "Backend is running"}, 200
app.register_blueprint(
api_bp,
url_prefix="/iammafah"
)
return app
app = create_app()
if __name__ == "__main__":
app.run()