from flask import Blueprint, jsonify from main import main as data_collection from . import bp @bp.route('/health') def health(): return jsonify({"message": "OK"}), 200 @bp.route('/trigger-data-collection', methods=['GET']) def trigger_data_collection(): """ This endpoint manually triggers the data collection process defined in main.py. HTTP Method: GET (you can switch to POST if you prefer). """ data_collection() # This calls the Prefect flow that orchestrates data collection return jsonify({"message": "Data collection triggered successfully"}), 200