chore: add base config and package structure

This commit is contained in:
ila
2026-07-04 23:24:51 +08:00
parent 5a7ea348e5
commit 79c57a63c5
14 changed files with 96 additions and 6 deletions
+14
View File
@@ -1,2 +1,16 @@
import os
class BaseConfig:
JSON_AS_ASCII = False
def load_config_from_env(environ=None):
source = environ or os.environ
return {
"CHIS_BASE_URL": source.get("CHIS_BASE_URL", ""),
"CHIS_PUBLIC_KEY": source.get("CHIS_PUBLIC_KEY", ""),
"REDIS_URL": source.get("REDIS_URL", "redis://localhost:6379/0"),
"LOG_DIR": source.get("LOG_DIR", "logs"),
"ARCHIVE_DIR": source.get("ARCHIVE_DIR", "archives"),
}