diff --git a/src/main.go b/src/main.go index 7d13c6b..e7d8c6b 100644 --- a/src/main.go +++ b/src/main.go @@ -36,7 +36,8 @@ func main() { w.Write([]byte(html)) }) - log.Printf("Running on http://%s\n", os.Getenv("BASE_URL")) - log.Printf("Try oauth demo on http://%s/oauthdemo\n", os.Getenv("BASE_URL")) + log.Printf("Running on %s\n", os.Getenv("BASE_URL")) + log.Printf("Try oauth demo on %s/oauthdemo\n", os.Getenv("BASE_URL")) + log.Fatal(http.ListenAndServe(fmt.Sprintf("0.0.0.0:%s", os.Getenv("PORT")), mux)) } diff --git a/src/oauthdemo.go b/src/oauthdemo.go index 8f85271..d20cb3c 100644 --- a/src/oauthdemo.go +++ b/src/oauthdemo.go @@ -35,7 +35,7 @@ func init() { // Initialize the OAuth2 config once during package initialization googleOauthConfig = &oauth2.Config{ - RedirectURL: fmt.Sprintf("http://%s/google-oauth-callback", os.Getenv("BASE_URL")), + RedirectURL: fmt.Sprintf("%s/google-oauth-callback", os.Getenv("BASE_URL")), ClientID: os.Getenv("GOOGLE_CLIENT_ID"), ClientSecret: os.Getenv("GOOGLE_CLIENT_SECRET"), Scopes: []string{