Initialize Tinder API Wrapper with server configuration and Docker setup

This commit is contained in:
2025-03-20 22:19:48 +01:00
commit e99b56e434
17 changed files with 1459 additions and 0 deletions

View 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)
}