Files
osdb-1-claude-opusplan/backend/internal/config/config.go
T
juliaandClaude Sonnet 4.6 24a368cac3 feat: bootstrap OSDB full-stack skeleton (story #01)
- Go backend: Echo v4 + pgxpool + embedded golang-migrate; health endpoints
  at /health and /api/v1/health; TDD health handler (httptest)
- Vue 3 frontend: Vite + TypeScript + Pinia + vue-router + Tailwind CSS v4;
  TDD HelloWorld component (@vue/test-utils + jsdom + vitest)
- Infra: docker-compose postgres:16 with env-interpolated credentials;
  Makefile with dev-db health-wait loop, migrate-up/down, run, test, fmt
- embed.FS migrations at backend/migrations/ (000001 no-op baseline)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 17:04:32 +02:00

31 lines
557 B
Go

package config
import (
"os"
)
// Config holds application configuration loaded from the environment.
type Config struct {
DatabaseURL string
Port string
}
// Load reads configuration from environment variables.
// DATABASE_URL is required; PORT defaults to "3000".
func Load() *Config {
dbURL := os.Getenv("DATABASE_URL")
if dbURL == "" {
dbURL = "postgres://osdb:osdb@localhost:5432/osdb?sslmode=disable"
}
port := os.Getenv("PORT")
if port == "" {
port = "3000"
}
return &Config{
DatabaseURL: dbURL,
Port: port,
}
}