Backend structure / login with JWT
This commit is contained in:
@@ -9,12 +9,14 @@ func defaultValue(val string, def string) string {
|
||||
return val
|
||||
}
|
||||
|
||||
func LoadEnv() map[string]string {
|
||||
var Env map[string]string
|
||||
|
||||
func LoadEnv() {
|
||||
// Create object where to store used variables
|
||||
env := make(map[string]string, 1)
|
||||
Env = make(map[string]string)
|
||||
|
||||
// Get env variables that will be used while server is running
|
||||
env["db"] = defaultValue(os.Getenv("POSTGRES_DB"), "postgresql://postgres:postgres@db:5432/cover-letter")
|
||||
|
||||
return env
|
||||
Env["db"] = defaultValue(os.Getenv("POSTGRES_DB"), "postgresql://postgres:postgres@db:5432/cover-letter")
|
||||
Env["JWT_SECRET"] = defaultValue(os.Getenv("JWT_SECRET"), "just a random string here")
|
||||
Env["Environment"] = defaultValue(os.Getenv("Environment"), "dev")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user