diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -66,6 +66,9 @@ func main() { | |||
66 | renderer := frontend.New("views") | 66 | renderer := frontend.New("views") |
67 | login := charakterin.New(db) | 67 | login := charakterin.New(db) |
68 | login.UseRenderer(renderer) | 68 | login.UseRenderer(renderer) |
69 | if config.AnilistAPI.ClientID != "" && config.AnilistAPI.ClientSecret != "" { | ||
70 | login.EnableAnilistAPI(config.AnilistAPI.ClientID, config.AnilistAPI.ClientSecret) | ||
71 | } | ||
69 | 72 | ||
70 | router := httprouter.New() | 73 | router := httprouter.New() |
71 | 74 | ||
@@ -87,6 +90,8 @@ func main() { | |||
87 | router.HandlerFunc("GET", "/logout", login.Logout) | 90 | router.HandlerFunc("GET", "/logout", login.Logout) |
88 | router.HandlerFunc("GET", "/register", login.DisplayRegistration) | 91 | router.HandlerFunc("GET", "/register", login.DisplayRegistration) |
89 | router.HandlerFunc("POST", "/register", login.Register) | 92 | router.HandlerFunc("POST", "/register", login.Register) |
93 | router.GET("/settings/api/:type/couple", login.DisplayAPICouplePage) | ||
94 | router.POST("/settings/api/:type/couple", login.CoupleAPI) | ||
90 | 95 | ||
91 | fs := http.FileServer(http.Dir("assets")) | 96 | fs := http.FileServer(http.Dir("assets")) |
92 | http.Handle("/assets/", http.StripPrefix("/assets/", fs)) | 97 | http.Handle("/assets/", http.StripPrefix("/assets/", fs)) |