Files
dejo-node/internal/api/server.go
2025-05-23 10:44:32 -03:00

21 lines
665 B
Go

package api
import (
"github.com/gorilla/mux"
"net/http"
"dejo_node/internal/ws"
)
func NewServer(handler *Handler) http.Handler {
r := mux.NewRouter()
// ⚠️ Endpoints removidos temporariamente pois ainda não foram implementados
// r.HandleFunc("/block/latest", handler.GetLatestBlock).Methods("GET")
// r.HandleFunc("/block/{index}", handler.GetBlockByIndex).Methods("GET")
// r.HandleFunc("/tx/{hash}", handler.GetTransactionByHash).Methods("GET")
// r.HandleFunc("/tx", handler.PostTransaction).Methods("POST")
// r.HandleFunc("/oracle/{key}", handler.GetOracleValue).Methods("GET")
r.HandleFunc("/ws", ws.HandleWS).Methods("GET")
return r
}