Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ logging.basicConfig(level=logging.INFO)
|
|
| 15 |
# --- 初始化 FastAPI 應用 ---
|
| 16 |
app = FastAPI(
|
| 17 |
title="台灣地震速報 API",
|
| 18 |
-
description="一個從台灣中央氣象署(CWA)公開預警XML Feed中,擷取最新地震速報的API。",
|
| 19 |
version="1.0.0",
|
| 20 |
)
|
| 21 |
|
|
@@ -117,14 +117,16 @@ def root():
|
|
| 117 |
return {
|
| 118 |
"message": "歡迎使用台灣地震速報 API",
|
| 119 |
"documentation": "/docs",
|
| 120 |
-
"earthquake_feed_endpoint": "/cwa-earthquakes"
|
|
|
|
|
|
|
| 121 |
}
|
| 122 |
|
| 123 |
@app.get("/cwa-earthquakes")
|
| 124 |
async def get_earthquakes_endpoint():
|
| 125 |
"""
|
| 126 |
提供最新的地震速報。
|
| 127 |
-
|
| 128 |
此端點會從 CWA 的公開預警 Feed 中擷取資料,
|
| 129 |
篩選出來自「中央氣象署」的「地震速報」,
|
| 130 |
並以 JSON 格式回傳。
|
|
|
|
| 15 |
# --- 初始化 FastAPI 應用 ---
|
| 16 |
app = FastAPI(
|
| 17 |
title="台灣地震速報 API",
|
| 18 |
+
description="一個從台灣中央氣象署(CWA)公開預警XML Feed中,擷取最新地震速報的API。https://cwadayi-app-show-pws.hf.space/cwa-earthquakes",
|
| 19 |
version="1.0.0",
|
| 20 |
)
|
| 21 |
|
|
|
|
| 117 |
return {
|
| 118 |
"message": "歡迎使用台灣地震速報 API",
|
| 119 |
"documentation": "/docs",
|
| 120 |
+
"earthquake_feed_endpoint": "/cwa-earthquakes",
|
| 121 |
+
"https://cwadayi-app-show-pws.hf.space/cwa-earthquakes",
|
| 122 |
+
"https://cwadayi-app-show-pws.hf.space/docs"
|
| 123 |
}
|
| 124 |
|
| 125 |
@app.get("/cwa-earthquakes")
|
| 126 |
async def get_earthquakes_endpoint():
|
| 127 |
"""
|
| 128 |
提供最新的地震速報。
|
| 129 |
+
https://cwadayi-app-show-pws.hf.space/cwa-earthquakes
|
| 130 |
此端點會從 CWA 的公開預警 Feed 中擷取資料,
|
| 131 |
篩選出來自「中央氣象署」的「地震速報」,
|
| 132 |
並以 JSON 格式回傳。
|