chore: change env names

This commit is contained in:
2025-06-21 21:39:43 +03:00
parent 3a478cb28d
commit 2435088eef
3 changed files with 56 additions and 66 deletions
+6 -6
View File
@@ -11,15 +11,15 @@ type Config struct {
}
func Load() (*Config, error) {
dir := os.Getenv("BASE_PATH")
db := os.Getenv("DB_LINK")
libDir := os.Getenv("LIBRARY_DIR")
dataDir := os.Getenv("DATA_DIR")
if dir == "" || db == "" {
return nil, errors.New("must set BASE_PATH and DB_LINK in env")
if libDir == "" || dataDir == "" {
return nil, errors.New("must set LIBRARY_DIR and DATA_DIR in env")
}
return &Config{
BaseDir: dir,
DBPath: db,
BaseDir: libDir,
DBPath: dataDir + "/YaBL.db",
}, nil
}