package config import ( "phc/website/sl" "github.com/joho/godotenv" ) var Slot = sl.NewSlot[*Config]() type Config struct { Mode string Host string } func Load(l *sl.ServiceLocator) (*Config, error) { m, err := godotenv.Read(".env") if err != nil { return nil, err } mode := "production" if v, ok := m["MODE"]; ok { mode = v } host := ":4000" if v, ok := m["HOST"]; ok { host = v } return &Config{ mode, host, }, nil }