Reshama commited on
Commit
5ab8ccc
·
verified ·
1 Parent(s): 19dd17f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -15
app.py CHANGED
@@ -2,25 +2,15 @@ from flask import Flask, render_template, request, jsonify, session, send_from_d
2
  import os
3
  from llms import prompt_llm_image, prompt_llm, parse_bullet_points
4
  app = Flask(__name__)
 
5
 
6
-
7
- from flask import jsonify
8
-
9
- @app.get("/health")
10
  def health():
11
  return jsonify(status="ok")
12
 
13
- @app.get("/_routes")
14
- def _routes():
15
- # show all registered routes so we can confirm what's live
16
- routes = []
17
- for rule in app.url_map.iter_rules():
18
- routes.append({
19
- "endpoint": rule.endpoint,
20
- "methods": sorted(list(rule.methods - {"HEAD", "OPTIONS"})),
21
- "rule": str(rule)
22
- })
23
- return jsonify(routes=sorted(routes, key=lambda r: r["rule"]))
24
 
25
 
26
 
 
2
  import os
3
  from llms import prompt_llm_image, prompt_llm, parse_bullet_points
4
  app = Flask(__name__)
5
+ from flask import jsonify, Response
6
 
7
+ @app.route("/health", methods=["GET"])
 
 
 
8
  def health():
9
  return jsonify(status="ok")
10
 
11
+ @app.route("/ping", methods=["GET"])
12
+ def ping():
13
+ return Response("pong", mimetype="text/plain")
 
 
 
 
 
 
 
 
14
 
15
 
16