Merry99 commited on
Commit
65ab48f
ยท
1 Parent(s): 3570179

add method HEAD on /health

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -87,8 +87,12 @@ def root():
87
  "user_dataset": "/user_dataset/{user_id}"
88
  }
89
  }
 
 
 
 
90
 
91
- @app.get("/health", methods=["GET", "HEAD"])
92
  def health():
93
  try:
94
  # ๊ฐ„๋‹จํ•œ health ์ฒดํฌ - DB ์—ฐ๊ฒฐ ์—†์ด ์„œ๋ฒ„ ์ƒํƒœ๋งŒ ํ™•์ธ
 
87
  "user_dataset": "/user_dataset/{user_id}"
88
  }
89
  }
90
+
91
+ @app.head("/health")
92
+ async def health_head():
93
+ return None # HEAD๋Š” ๋ฐ”๋””๊ฐ€ ํ•„์š” ์—†์œผ๋ฏ€๋กœ None ๋ฐ˜ํ™˜
94
 
95
+ @app.get("/health")
96
  def health():
97
  try:
98
  # ๊ฐ„๋‹จํ•œ health ์ฒดํฌ - DB ์—ฐ๊ฒฐ ์—†์ด ์„œ๋ฒ„ ์ƒํƒœ๋งŒ ํ™•์ธ