Skip to content

Add a Health Check Endpoint #9

@arya2004

Description

@arya2004

It's a common practice to have a simple endpoint that can be used to verify that the service is running.

Task: Add a /health route to main.py that returns a simple JSON response with a 200 OK status.

# ...existing code...
@app.route("/health", methods=["GET"])
def health_check():
    """Health check endpoint to verify the service is running."""
    return jsonify({"status": "ok"}), 200

if __name__ == "__main__":
    app.run(debug=True, port=os.getenv("PORT", default=5000))

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions