Rthur2003 commited on
Commit
7fc865b
·
1 Parent(s): 5b71488

feat: add FastAPI application entrypoint with routes and error handlers

Browse files
Files changed (1) hide show
  1. app/main.py +8 -1
app/main.py CHANGED
@@ -28,8 +28,15 @@ setup_logging(level=os.getenv("LOG_LEVEL", "INFO"))
28
  logger = get_logger(__name__)
29
 
30
 
 
 
 
 
 
 
 
31
  def _load_origins() -> list[str]:
32
- raw = os.getenv("CROWNCODE_CORS_ORIGINS") or os.getenv("CORS_ORIGIN") or "http://localhost:3000"
33
  if raw.strip() == "*":
34
  logger.warning(
35
  "CORS wildcard '*' is not recommended for production. "
 
28
  logger = get_logger(__name__)
29
 
30
 
31
+ _DEFAULT_CORS_ORIGINS = (
32
+ "http://localhost:3000,"
33
+ "https://hasan-arthur-altuntas.xyz,"
34
+ "https://www.hasan-arthur-altuntas.xyz"
35
+ )
36
+
37
+
38
  def _load_origins() -> list[str]:
39
+ raw = os.getenv("CROWNCODE_CORS_ORIGINS") or os.getenv("CORS_ORIGIN") or _DEFAULT_CORS_ORIGINS
40
  if raw.strip() == "*":
41
  logger.warning(
42
  "CORS wildcard '*' is not recommended for production. "