fix: remove unused env and fix typo
This commit is contained in:
parent
b1dd6f2c3b
commit
3ac0b44446
|
@ -13,7 +13,6 @@ var (
|
||||||
JWT_TYPE = ""
|
JWT_TYPE = ""
|
||||||
JWT_SECRET = ""
|
JWT_SECRET = ""
|
||||||
ALLOWED_ORIGINS = []string{}
|
ALLOWED_ORIGINS = []string{}
|
||||||
ALLOWED_CALLBACK_URLS = []string{}
|
|
||||||
AUTHORIZER_URL = ""
|
AUTHORIZER_URL = ""
|
||||||
PORT = "8080"
|
PORT = "8080"
|
||||||
REDIS_URL = ""
|
REDIS_URL = ""
|
||||||
|
|
|
@ -16,7 +16,7 @@ var Version string
|
||||||
// ParseArgs -> to parse the cli flag and get db url. This is useful with heroku button
|
// ParseArgs -> to parse the cli flag and get db url. This is useful with heroku button
|
||||||
func ParseArgs() {
|
func ParseArgs() {
|
||||||
dbURL := flag.String("database_url", "", "Database connection string")
|
dbURL := flag.String("database_url", "", "Database connection string")
|
||||||
dbType := flag.String("databse_type", "", "Database type, possible values are postgres,mysql,sqlite")
|
dbType := flag.String("database_type", "", "Database type, possible values are postgres,mysql,sqlite")
|
||||||
authorizerURL := flag.String("authorizer_url", "", "URL for authorizer instance, eg: https://xyz.herokuapp.com")
|
authorizerURL := flag.String("authorizer_url", "", "URL for authorizer instance, eg: https://xyz.herokuapp.com")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
@ -104,19 +104,6 @@ func InitEnv() {
|
||||||
}
|
}
|
||||||
constants.ALLOWED_ORIGINS = allowedOrigins
|
constants.ALLOWED_ORIGINS = allowedOrigins
|
||||||
|
|
||||||
allowedCallbackSplit := strings.Split(os.Getenv("ALLOWED_CALLBACK_URLS"), ",")
|
|
||||||
allowedCallbacks := []string{}
|
|
||||||
for _, val := range allowedCallbackSplit {
|
|
||||||
trimVal := strings.TrimSpace(val)
|
|
||||||
if trimVal != "" {
|
|
||||||
allowedCallbacks = append(allowedCallbacks, trimVal)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(allowedCallbackSplit) == 0 {
|
|
||||||
allowedCallbackSplit = []string{"*"}
|
|
||||||
}
|
|
||||||
constants.ALLOWED_CALLBACK_URLS = allowedCallbackSplit
|
|
||||||
|
|
||||||
ParseArgs()
|
ParseArgs()
|
||||||
if constants.DATABASE_URL == "" {
|
if constants.DATABASE_URL == "" {
|
||||||
panic("Database url is required")
|
panic("Database url is required")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user