Initialize Tinder API Wrapper with server configuration and Docker setup
This commit is contained in:
28
cmd/server/router/router.go
Normal file
28
cmd/server/router/router.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
tinder "tinder-api-wrapper"
|
||||
"tinder-api-wrapper/cmd/server/handlers"
|
||||
)
|
||||
|
||||
// Setup creates and configures the HTTP router
|
||||
func Setup(client *tinder.Client) http.Handler {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
// Core endpoints
|
||||
mux.HandleFunc("/like/", handlers.HandleLike(client))
|
||||
mux.HandleFunc("/pass/", handlers.HandlePass(client))
|
||||
mux.HandleFunc("/v2/recs/core", handlers.HandleGetRecs(client))
|
||||
|
||||
// Auth endpoints
|
||||
mux.HandleFunc("/v2/auth/sms/send", handlers.HandleSendPhoneAuth(client))
|
||||
mux.HandleFunc("/v2/auth/sms/validate", handlers.HandleValidateOTP(client))
|
||||
mux.HandleFunc("/v2/auth/facebook", handlers.HandleFacebookAuth(client))
|
||||
mux.HandleFunc("/v2/auth/login/refresh", handlers.HandleRefreshAuth(client))
|
||||
mux.HandleFunc("/v2/profile", handlers.HandleGetProfile(client))
|
||||
|
||||
// Wrap with logging middleware
|
||||
return handlers.LogMiddleware(mux)
|
||||
}
|
||||
Reference in New Issue
Block a user