-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb_server.py
More file actions
59 lines (49 loc) · 2.08 KB
/
web_server.py
File metadata and controls
59 lines (49 loc) · 2.08 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python
"""
Web Server Entry Point for Paper Reader
Run with: python web_server.py
"""
import os
import sys
import logging
from pathlib import Path
# Add project root to path
sys.path.insert(0, str(Path(__file__).parent))
# Setup logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
def main():
import uvicorn
from backend.app import app
# Get configuration from environment
host = os.getenv("HOST", "0.0.0.0")
port = int(os.getenv("PORT", "8000"))
reload = os.getenv("RELOAD", "false").lower() == "true"
print(f"""
╔══════════════════════════════════════════════════════════════╗
║ ║
║ 📚 Paper Reader Web Interface ║
║ ║
║ Server running at: http://localhost:{port} ║
║ ║
║ Features: ║
║ • Upload PDF papers ║
║ • AI-powered hierarchical analysis (1+3+1 agents) ║
║ • Bilingual reports (English + Chinese) ║
║ • Export to PDF/DOCX/Markdown ║
║ • Chat with AI about the paper ║
║ • Full analysis history ║
║ ║
╚══════════════════════════════════════════════════════════════╝
""")
uvicorn.run(
"backend.app:app",
host=host,
port=port,
reload=reload,
log_level="info"
)
if __name__ == "__main__":
main()