Basic REST app
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package envconfig
|
||||
|
||||
import "os"
|
||||
|
||||
type EnvConfig struct {
|
||||
Port string
|
||||
}
|
||||
|
||||
func Load() EnvConfig {
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "4321"
|
||||
}
|
||||
|
||||
return EnvConfig{
|
||||
Port: port,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user