22 lines
616 B
Python
22 lines
616 B
Python
from flask import Flask
|
|
from blueprints import auth_blueprint, user_blueprint, default_blueprint
|
|
from database import init_db
|
|
from configs import Config # Import the config class
|
|
|
|
app = Flask(__name__)
|
|
|
|
# Apply configurations environtment
|
|
app.config["FLASK_ENV"] = Config.FLASK_ENV
|
|
app.config["DEBUG"] = Config.DEBUG
|
|
|
|
# Initialize database
|
|
init_db(app)
|
|
|
|
# Register blueprints
|
|
app.register_blueprint(default_blueprint)
|
|
app.register_blueprint(auth_blueprint, url_prefix="/api")
|
|
app.register_blueprint(user_blueprint, url_prefix="/api")
|
|
|
|
if __name__ == "__main__":
|
|
app.run(debug=Config.DEBUG)
|