Rewritten in go

This commit is contained in:
MarcUs7i 2025-04-02 08:37:01 +02:00
parent b131756235
commit b17e528180
23 changed files with 989 additions and 18 deletions

26
internal/config/config.go Normal file
View file

@ -0,0 +1,26 @@
package config
import (
"os"
"github.com/joho/godotenv"
)
type Config struct {
MongoURI string
Port string
}
func New() *Config {
godotenv.Load()
port := os.Getenv("PORT")
if port == "" {
port = "5000"
}
return &Config{
MongoURI: os.Getenv("MONGO_URI"),
Port: port,
}
}