added basic skeleton and two API endpoints to test backend stack.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package envvars
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func Int(key string) int {
|
||||
value := os.Getenv(key)
|
||||
if value == "" {
|
||||
return 0
|
||||
}
|
||||
|
||||
intValue, err := strconv.Atoi(value)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
return intValue
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package envvars
|
||||
|
||||
import "os"
|
||||
|
||||
func String(key string) string {
|
||||
return os.Getenv(key)
|
||||
}
|
||||
Reference in New Issue
Block a user