mirror of
https://github.com/Kizuren/uLinkShortener.git
synced 2025-12-21 21:16:17 +01:00
Rewritten in go
This commit is contained in:
parent
b131756235
commit
b17e528180
23 changed files with 989 additions and 18 deletions
26
internal/config/config.go
Normal file
26
internal/config/config.go
Normal 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,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue