-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (32 loc) · 951 Bytes
/
main.py
File metadata and controls
38 lines (32 loc) · 951 Bytes
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
from fastapi.staticfiles import StaticFiles
import os
import uvicorn
from dotenv import load_dotenv
from api.http import ContestantRouter
from managers.base import BaseLoader
from utils import console
if __name__ == "__main__":
# Print the logo
print("""
__ __ __
\\ \\/ /_ ____ __/ /__(_)
\\ / / / / / / / //_/ /
/ / /_/ / /_/ / ,< / /
/_/\\__,_/\\__,_/_/|_/_/
/ ___/____ / __/ /__ ______ _________
\\__ \\/ __ \\/ /_/ __/ | /| / / __ `/ ___/ _ \\
___/ / /_/ / __/ /_ | |/ |/ / /_/ / / / __/
/____/\\____/_/ \\__/ |__/|__/\\__/_/_/ \\___/
""")
console.setup()
load_dotenv()
base = BaseLoader()
base.server.mount("/ui", StaticFiles(directory="web", html=True))
base.server.mount("/api", ContestantRouter(base))
uvicorn.run(
base.server,
host="0.0.0.0",
port=os.getenv("PORT", 8080),
loop="asyncio",
log_config=None
)