Created
September 13, 2019 08:20
-
-
Save BNPrashanth/9ae6d2a34bf3e0697d5bded50e592620 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"github.com/gs-open-provider/poc-go-oauth2/internal/configs" | |
"github.com/gs-open-provider/poc-go-oauth2/internal/logger" | |
"github.com/gs-open-provider/poc-go-oauth2/internal/services" | |
"github.com/spf13/viper" | |
) | |
func main() { | |
// Initialize Viper across the application | |
configs.InitializeViper() | |
// Initialize Logger across the application | |
logger.InitializeZapCustomLogger() | |
// Initialize Oauth2 Services | |
services.InitializeOAuthGoogle() | |
// Routes for the application | |
http.HandleFunc("/", services.HandleMain) | |
http.HandleFunc("/login-gl", services.HandleGoogleLogin) | |
http.HandleFunc("/callback-gl", services.CallBackFromGoogle) | |
logger.Log.Info("Started running on http://localhost:" + viper.GetString("port")) | |
log.Fatal(http.ListenAndServe(":"+viper.GetString("port"), nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment