mirror of
https://github.com/Kizuren/uLinkShortener.git
synced 2025-12-21 21:16:17 +01:00
26 lines
No EOL
359 B
Go
26 lines
No EOL
359 B
Go
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,
|
|
}
|
|
} |