Compare commits

..

2 Commits

Author SHA1 Message Date
ALIHAN DIKEL
3ebc9fb142 Merge branch 'main' of https://gitea.umutalihandikel.com/alihan/agent-transcriptor 2025-03-10 15:40:59 +03:00
ALIHAN DIKEL
a0e8d8bcb5 fix script issue 2025-03-10 15:40:42 +03:00

View File

@@ -1,22 +1,30 @@
import os
import sys
from dotenv import load_dotenv
import uvicorn
load_dotenv("env")
# Load environment variables from .env file
load_dotenv()
# Get variables with defaults
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", "9999"))
PORT = int(os.getenv("PORT", "8000"))
RELOAD = os.getenv("RELOAD", "True").lower() == "true"
APP_MODULE = os.getenv("APP_MODULE", "main:app")
WORKING_DIR = os.getenv("WORKING_DIR", os.getcwd())
def main():
uvicorn.run(
"main:app",
host=HOST,
port=PORT,
reload=RELOAD
)
"""Run the uvicorn server directly using the Python API"""
# Change to the specified working directory
os.chdir(WORKING_DIR)
# Add the working directory to Python path if needed
if WORKING_DIR not in sys.path:
sys.path.insert(0, WORKING_DIR)
uvicorn.run(APP_MODULE, host=HOST, port=PORT, reload=RELOAD)
if __name__ == "__main__":