add: 部署文件

This commit is contained in:
lizhongxiang 2025-02-26 18:03:40 +08:00
parent 6fe03995c6
commit fe43d824c5
2 changed files with 5 additions and 3 deletions

4
app.py
View file

@ -1,8 +1,12 @@
import asyncio
import os
from pathlib import Path
from config.logger import setup_logging
from config.settings import load_config
from core.server import WebSocketServer
os.environ["PROJECT_ROOT_PATH"] = str(Path(__file__).resolve().parent)
async def main():
setup_logging() # 最先初始化日志

View file

@ -6,9 +6,7 @@ import json
def get_project_dir():
projectName = 'xiaozhi-esp32-server'
filePath = os.path.abspath(__file__)
return filePath[:filePath.rfind('/' + projectName + '/') + len(projectName) + 2]
return os.environ["PROJECT_ROOT_PATH"]
def get_local_ip():