File size: 1,886 Bytes
7b2787b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
Simple run script for the Workflow Engine.

Usage:
    python run.py
    
Or with custom settings:
    HOST=127.0.0.1 PORT=8080 python run.py
"""

import uvicorn
import os


def main():
    """Run the FastAPI application."""
    host = os.getenv("HOST", "0.0.0.0")
    port = int(os.getenv("PORT", "8000"))
    reload = os.getenv("RELOAD", "true").lower() == "true"
    
    print(f"""
╔═══════════════════════════════════════════════════════════════╗
β•‘                      FlowGraph πŸ”„                             β•‘
β•‘                                                               β•‘
β•‘  A lightweight workflow orchestration engine                  β•‘
╠═══════════════════════════════════════════════════════════════╣
β•‘  Server:    http://{host}:{port}                                 β•‘
β•‘  API Docs:  http://{host}:{port}/docs                            β•‘
β•‘  ReDoc:     http://{host}:{port}/redoc                           β•‘
╠═══════════════════════════════════════════════════════════════╣
β•‘  Demo workflow ID: code-review-demo                           β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
    """)
    
    uvicorn.run(
        "app.main:app",
        host=host,
        port=port,
        reload=reload,
        log_level="info",
    )


if __name__ == "__main__":
    main()