-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
31 lines (25 loc) · 723 Bytes
/
Copy pathconfig.py
File metadata and controls
31 lines (25 loc) · 723 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
class Config:
# Server settings
HOST = "0.0.0.0"
PORT = 58353
RELOAD = True
# API settings
TITLE = "Codeforces Stats API"
DESCRIPTION = "A FastAPI app for the Codeforces Stats"
VERSION = "1.0.0"
# CORS settings
CORS_ALLOW_ORIGINS = ["*"]
CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_METHODS = ["*"]
CORS_ALLOW_HEADERS = ["*"]
# Environment settings
ENV = "production" # or "development"
@classmethod
def is_dev(cls):
return cls.ENV == "development"
@classmethod
def get_host(cls):
return cls.HOST if cls.is_dev() else "127.0.0.1"
@classmethod
def get_port(cls):
return cls.PORT if cls.is_dev() else 8000