Parcourir la source

join via api - netmaker changes

Signed-off-by: Matthew R. Kasun <[email protected]>
Matthew R. Kasun il y a 3 ans
Parent
commit
8a75ef5931
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1 1
      controllers/node.go
  2. 1 1
      netclient/functions/join.go

+ 1 - 1
controllers/node.go

@@ -31,7 +31,7 @@ func nodeHandlers(r *mux.Router) {
 	r.HandleFunc("/api/nodes/{network}/{nodeid}/createingress", securityCheck(false, http.HandlerFunc(createIngressGateway))).Methods("POST")
 	r.HandleFunc("/api/nodes/{network}/{nodeid}/deleteingress", securityCheck(false, http.HandlerFunc(deleteIngressGateway))).Methods("DELETE")
 	r.HandleFunc("/api/nodes/{network}/{nodeid}/approve", authorize(true, "user", http.HandlerFunc(uncordonNode))).Methods("POST")
-	r.HandleFunc("/api/nodes/{network}", createNode).Methods("POST")
+	r.HandleFunc("/api/nodes/join", createNode).Methods("POST")
 	r.HandleFunc("/api/nodes/adm/{network}/lastmodified", authorize(true, "network", http.HandlerFunc(getLastModified))).Methods("GET")
 	r.HandleFunc("/api/nodes/adm/{network}/authenticate", authenticate).Methods("POST")
 }

+ 1 - 1
netclient/functions/join.go

@@ -108,7 +108,7 @@ func JoinNetwork(cfg *config.ClientConfig, privateKey string) error {
 	}
 
 	log.Println("calling api")
-	response, err := join(request, cfg.Server.API, cfg.Node.AccessKey)
+	response, err := join(request, cfg.Server.API+"/api/nodes/join", cfg.Node.AccessKey)
 	if err != nil {
 		return fmt.Errorf("error joining network %w", err)
 	}