go-cook-portal/services/config.go
2024-04-09 07:29:45 -07:00

26 lines
347 B
Go

package services
import (
"log"
"os"
"github.com/joho/godotenv"
)
type EnvConfig struct {
ApiServerUri string
CookieSecret string
}
func NewEnvConfig() EnvConfig {
err := godotenv.Load()
if err != nil {
log.Println(err)
}
return EnvConfig{
ApiServerUri: os.Getenv("ApiServerUri"),
CookieSecret: os.Getenv("CookieSecret"),
}
}