2024-03-05 16:01:26 +01:00
|
|
|
from flask import Flask
|
|
|
|
from flask_jwt_extended import JWTManager
|
2024-03-10 21:41:48 +01:00
|
|
|
from flask_mail import Mail
|
2024-03-12 20:12:19 +01:00
|
|
|
from flasgger import Swagger
|
|
|
|
from flask_cors import CORS
|
2024-03-05 16:01:26 +01:00
|
|
|
|
2024-03-05 21:35:58 +01:00
|
|
|
app = Flask(__name__)
|
|
|
|
jwt_manager = JWTManager(app)
|
2024-03-10 21:41:48 +01:00
|
|
|
mail = Mail(app)
|
2024-03-12 20:12:19 +01:00
|
|
|
swag = Swagger(app)
|
|
|
|
cors = CORS(app)
|
2024-03-05 16:01:26 +01:00
|
|
|
|
2024-03-05 21:35:58 +01:00
|
|
|
def create_app():
|
2024-03-08 14:04:40 +01:00
|
|
|
from app.api import bp, bp_errors, bp_product, bp_user, bp_cart
|
2024-03-05 16:01:26 +01:00
|
|
|
app.register_blueprint(bp)
|
|
|
|
app.register_blueprint(bp_errors)
|
|
|
|
app.register_blueprint(bp_product)
|
|
|
|
app.register_blueprint(bp_user)
|
2024-03-08 14:04:40 +01:00
|
|
|
app.register_blueprint(bp_cart)
|
2024-03-05 16:01:26 +01:00
|
|
|
|
|
|
|
from app.config import FlaskTesting, FlaskProduction
|
|
|
|
app.config.from_object(FlaskTesting)
|
|
|
|
|
2024-03-07 07:51:58 +01:00
|
|
|
from . import jwt_utils
|
|
|
|
|
2024-03-05 16:01:26 +01:00
|
|
|
return app
|