-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
38 lines (30 loc) · 854 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"fmt"
"log"
"net/http"
"os"
"github.com/qt-luigi/go-auth-sample/firebase"
"github.com/qt-luigi/go-auth-sample/google"
"github.com/qt-luigi/go-auth-sample/index"
"github.com/qt-luigi/go-auth-sample/openid"
)
func init() {
// Set Index page handlers
http.HandleFunc("/", index.IndexHandler)
// Set Google Sign-in handlers
http.HandleFunc("/loginGoogle", google.LoginHandler)
http.HandleFunc("/callbackGoogle", google.CallbackHandler)
http.HandleFunc("/redirectGoogle", google.RedirectHandler)
// Set Firebase Auth handlers
http.HandleFunc("/loginFirebase", firebase.LoginHandler)
// Set OpenID Connect handlers
http.HandleFunc("/loginOpenID", openid.LoginHandler)
}
func main() {
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil))
}