mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-04-26 10:31:05 +00:00
Creates the API layer for Open Notebook Creates a services API gateway for the Streamlit front-end Migrates the SurrealDB SDK to the official one Change all database calls to async New podcast framework supporting multiple speaker configurations Implement the surreal-commands library for async processing Improve docker image and docker-compose configurations
31 lines
754 B
Python
31 lines
754 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
Startup script for Open Notebook API server.
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import uvicorn
|
|
|
|
# Add the current directory to Python path so imports work
|
|
current_dir = Path(__file__).parent
|
|
sys.path.insert(0, str(current_dir))
|
|
|
|
if __name__ == "__main__":
|
|
# Default configuration
|
|
host = os.getenv("API_HOST", "127.0.0.1")
|
|
port = int(os.getenv("API_PORT", "5055"))
|
|
reload = os.getenv("API_RELOAD", "true").lower() == "true"
|
|
|
|
print(f"Starting Open Notebook API server on {host}:{port}")
|
|
print(f"Reload mode: {reload}")
|
|
|
|
uvicorn.run(
|
|
"api.main:app",
|
|
host=host,
|
|
port=port,
|
|
reload=reload,
|
|
reload_dirs=[str(current_dir)] if reload else None,
|
|
)
|