feat: initialize flask app skeleton
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
from flask import Flask
|
||||
|
||||
|
||||
def create_app(config_object=None):
|
||||
app = Flask(__name__)
|
||||
|
||||
if config_object:
|
||||
if isinstance(config_object, dict):
|
||||
app.config.update(config_object)
|
||||
else:
|
||||
app.config.from_object(config_object)
|
||||
|
||||
from app.api.health import bp as health_bp
|
||||
|
||||
app.register_blueprint(health_bp)
|
||||
return app
|
||||
@@ -0,0 +1 @@
|
||||
"""API blueprints."""
|
||||
@@ -0,0 +1,9 @@
|
||||
from flask import Blueprint, jsonify
|
||||
|
||||
|
||||
bp = Blueprint("health", __name__)
|
||||
|
||||
|
||||
@bp.get("/health")
|
||||
def health_check():
|
||||
return jsonify({"ok": True})
|
||||
@@ -0,0 +1,2 @@
|
||||
class BaseConfig:
|
||||
JSON_AS_ASCII = False
|
||||
Reference in New Issue
Block a user