aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorrtz12 <koenig@fagott.pw>2016-11-13 02:47:19 (UTC)
committerrtz12 <koenig@fagott.pw>2016-11-13 02:47:19 (UTC)
commitc6df1d768240d14e8129b51d6916931f1c4f35db (patch)
tree4aba83338c8a732e0d40887f9cabe3aeaa1f6d26 /main.go
parentc5517076f492e878a21123ae4bcb927f25bbc0a2 (diff)
Anilist-API in Grilist implementiert
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index ad3dd84..240ca1a 100644
--- a/main.go
+++ b/main.go
@@ -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))