
from flask import Blueprint, jsonify

# The blueprint instance is named after the current module without dots to avoid a ValueError on registration.
blueprint = Blueprint(__name__.rsplit(".", 1)[-1], __name__)

# This function handles HTTP GET requests to the root path and returns a simple health-check response.
@blueprint.route("/", methods=["GET"])
def index():

    # The function returns a JSON object indicating that the API is operational.
    return jsonify({"message": "The API is working.", "status": "OK"})
