Files
dejo-node/internal/api/server.go
2025-06-17 18:26:14 -03:00

20 lines
366 B
Go

package api
import (
"dejo_node/internal/ws"
"net/http"
"github.com/gorilla/mux"
)
func NewServer(handler *Handler) http.Handler {
r := mux.NewRouter()
// Endpoints básicos
r.HandleFunc("/ping", handler.Ping).Methods("GET")
r.HandleFunc("/consensus", handler.HandleConsensus).Methods("POST")
r.HandleFunc("/ws", ws.HandleWS).Methods("GET")
return r
}