Spaces:
Sleeping
Sleeping
File size: 756 Bytes
a686b1b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
"""
Servidor API REST para RAG Template.
Executa servidor FastAPI/Uvicorn.
"""
import uvicorn
import os
from dotenv import load_dotenv
# Carregar variaveis de ambiente
load_dotenv()
if __name__ == "__main__":
# Configuracoes
host = os.getenv("API_HOST", "0.0.0.0")
port = int(os.getenv("API_PORT", "8000"))
reload = os.getenv("API_RELOAD", "false").lower() == "true"
workers = int(os.getenv("API_WORKERS", "1"))
print(f"Starting RAG Template API server at http://{host}:{port}")
print(f"API docs available at http://{host}:{port}/api/docs")
# Executar servidor
uvicorn.run(
"src.api:app",
host=host,
port=port,
reload=reload,
workers=workers,
log_level="info"
)
|