-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
24 lines (17 loc) · 688 Bytes
/
app.py
File metadata and controls
24 lines (17 loc) · 688 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
from flask import Flask
from utils import db
from config import db_config, swagger_config, swaggerui_blueprint
from routes import userBp, storeBp, productBp, cartBp
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = db_config['SQLALCHEMY_DATABASE_URI']
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = db_config['SQLALCHEMY_TRACK_MODIFICATIONS']
db.init_app(app)
with app.app_context():
db.create_all()
app.register_blueprint(userBp)
app.register_blueprint(storeBp)
app.register_blueprint(productBp)
app.register_blueprint(cartBp)
app.register_blueprint(swaggerui_blueprint, url_prefix=swagger_config['SWAGGER_URL'])
if __name__ == '__main__':
app.run(debug=True)