INNER CODE UNIT · Python

about

stanfrbd/cyberbro · app.py:397

def about() -> tuple[str, int]:
    """Render the about page."""
    return render_template("about.html", version=app.config["VERSION"]), 200


@app.route(f"/{API_PREFIX}/results/<analysis_id>", methods=["GET"])
def get_results(analysis_id: str) -> tuple[Response, int]:
    """Get the results of the analysis."""
    analysis_results = db.session.get(AnalysisResult, analysis_id)
    if analysis_results:
        return jsonify(analysis_results.results), 200
    return jsonify({"error": "Analysis not found."}), 404


@app.route(f"/{API_PREFIX}/analyze", methods=["POST"])
def analyze_api() -> tuple[Response, int]:
    """Handle the analyze request via API with caching and hashing."""
    data: dict = request.get_json()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…