INNER CODE UNIT · Python
_is_production
evolution-foundation/evo-nexus · dashboard/backend/app.py:25
def _is_production() -> bool:
env = (
os.environ.get("EVONEXUS_ENV")
or os.environ.get("FLASK_ENV")
or os.environ.get("ENV")
or ""
).strip().lower()
return env in {"production", "prod"}
def _cors_allowed_origins():
raw = os.environ.get("CORS_ALLOWED_ORIGINS", "").strip()
if raw:
if raw == "*":
return "*"
origins = [origin.strip() for origin in re.split(r"[,\s]+", raw) if origin.strip()]
return origins or "*"
return "*" if not _is_production() else []