p2p-llm / routes.go
arpinfidel's picture
temp
48511d8
raw
history blame contribute delete
535 Bytes
package main
import (
"net/http"
"github.com/arpinfidel/p2p-llm/auth"
"github.com/arpinfidel/p2p-llm/peers"
"github.com/arpinfidel/p2p-llm/proxy"
)
func RegisterRoutes(
authHandler *auth.AuthHandler,
peerHandler *peers.PeerHandler,
jwtMiddleware *auth.JWTMiddleware,
proxyHandler *proxy.ProxyHandler,
) {
http.HandleFunc("/auth", authHandler.ServeHTTP)
http.HandleFunc("/trusted-peers", peerHandler.ListTrustedPeers)
http.Handle("/", jwtMiddleware.Middleware(http.HandlerFunc(proxyHandler.Handle)))
}