Skip to content

Commit

Permalink
switch to a correct env
Browse files Browse the repository at this point in the history
  • Loading branch information
nad2000 committed Nov 13, 2019
1 parent 06e75db commit ce8c5b7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions handler/common.go
Expand Up @@ -39,22 +39,27 @@ var (
verbose bool
wg sync.WaitGroup
env string

// for testing/mocking
logFatal func(args ...interface{})
)

var (
// APIBaseURL is the UoA API base URL
APIBaseURL = "https://api.dev.auckland.ac.nz/service"
APIBaseURL string
// OHBaseURL is the ORCID Hub API base URL
OHBaseURL = "https://dev.orcidhub.org.nz"
OHBaseURL string
)

func init() {
godotenv.Load()

env = os.Getenv("ENV")
if env != "" && env != "prod" {
APIBaseURL = "https://api." + env + ".auckland.ac.nz/service"
OHBaseURL = "https://" + env + ".orcidhub.org.nz"
} else {
APIBaseURL = "https://api.auckland.ac.nz/service"
OHBaseURL = "https://orcidhub.org.nz"
}

isDevelopment := strings.Contains(env, "dev")

if verbose || isDevelopment {
Expand Down

0 comments on commit ce8c5b7

Please sign in to comment.