mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 09:03:54 +08:00
add basic OTA support for single server deployment
Committer: rxchen <rchentl@hotmail.com>
This commit is contained in:
@@ -48,6 +48,9 @@ class SimpleHttpServer:
|
||||
web.get("/xiaozhi/ota/", self.ota_handler.handle_get),
|
||||
web.post("/xiaozhi/ota/", self.ota_handler.handle_post),
|
||||
web.options("/xiaozhi/ota/", self.ota_handler.handle_post),
|
||||
# 下载接口,仅提供 data/bin/*.bin 下载
|
||||
web.get("/xiaozhi/ota/download/{filename}", self.ota_handler.handle_download),
|
||||
web.options("/xiaozhi/ota/download/{filename}", self.ota_handler.handle_download),
|
||||
]
|
||||
)
|
||||
# 添加路由
|
||||
@@ -67,4 +70,4 @@ class SimpleHttpServer:
|
||||
|
||||
# 保持服务运行
|
||||
while True:
|
||||
await asyncio.sleep(3600) # 每隔 1 小时检查一次
|
||||
await asyncio.sleep(3600) # 每隔 1 小时检查一次
|
||||
Reference in New Issue
Block a user