minimal working version of backend and cli

This commit is contained in:
2025-10-14 01:58:24 -04:00
parent 839f0c9107
commit 2fdb1ece43
9 changed files with 615 additions and 48 deletions

View File

@@ -5,19 +5,21 @@ import (
)
type Config struct {
DSN string // e.g. mysql: "user:pass@tcp(127.0.0.1:3306)/mind?parseTime=true"; sqlite: "file:mind.db?_pragma=busy_timeout(5000)"
DSN string
Driver string // "mysql" or "sqlite"
JWTSecret string
Port string // default 8080
Port string
LlamaURL string
}
func getenv(k, def string) string { v := os.Getenv(k); if v == "" { return def }; return v }
func Load() Config {
return Config{
DSN: getenv("DB_DSN", "file:mind.db?_pragma=busy_timeout(5000)"),
Driver: getenv("DB_DRIVER", "sqlite"),
JWTSecret: getenv("JWT_SECRET", "devsecret"),
Port: getenv("PORT", "8080"),
}
return Config{
DSN: getenv("DB_DSN", "file:mind.db?_pragma=busy_timeout(5000)"),
Driver: getenv("DB_DRIVER", "sqlite"),
JWTSecret: getenv("JWT_SECRET", "devsecret"),
Port: getenv("PORT", "8080"),
LlamaURL: getenv("LLAMA_URL", "http://localhost:8081"),
}
}