Node endpoints with container handling (#1)

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2026-02-04 22:14:11 +00:00
parent c28a54bf33
commit 79cd8fc9fd
6 changed files with 158 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ import (
"net/http"
"os"
"simple-cluster-node/health"
"simple-cluster-node/node"
"github.com/google/uuid"
"github.com/gorilla/mux"
@@ -14,15 +15,11 @@ import (
func SetupRouter() *mux.Router {
r := mux.NewRouter()
r.Use(identifyRequest, corsCheck, logRequest)
r.HandleFunc("/health", health.Handle).Methods("GET", "OPTIONS")
/*
r.HandleFunc("/album", handler.GetAlbums).Methods("GET", "OPTIONS")
r.HandleFunc("/album", handler.SaveAlbum).Methods("POST", "OPTIONS")
r.HandleFunc("/album/{albumId}", handler.DeleteAlbum).Methods("DELETE", "OPTIONS")
r.HandleFunc("/album/{albumId}", handler.GetAlbum).Methods("GET", "OPTIONS")
r.HandleFunc("/shareAlbum/{albumId}/{userId}", handler.ShareAlbum).Methods("POST", "OPTIONS")
*/
r.HandleFunc("/health", health.Handle).Methods("GET", "OPTIONS")
r.HandleFunc("/node/info", node.HandleInfo).Methods("GET", "OPTIONS")
r.HandleFunc("/node/start", node.HandleStart).Methods("POST", "OPTIONS")
r.HandleFunc("/node/stop", node.HandleStop).Methods("POST", "OPTIONS")
return r
}