commit inicial do projeto
This commit is contained in:
21
internal/api/server.go
Normal file
21
internal/api/server.go
Normal file
@ -0,0 +1,21 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user