package config

import (
	"fmt"
	"os"

	"github.com/joho/godotenv"
)

var Cfg Config

type Config struct {
	Host      string
	Port      string
	LogFolder string
}

func LoadConfig() {
	// used to determine server was startet in docker or not
	if os.Getenv("DOCKER") == "" {
		fmt.Println("Load env from file")
		godotenv.Load(".env")
	} else {
		fmt.Println("Load env from system")
	}

	Cfg = Config{

		Host:      os.Getenv("HOST"),
		Port:      os.Getenv("PORT"),
		LogFolder: os.Getenv("LOG_FOLDER"),
	}
}
