File size: 535 Bytes
48511d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)))
}